Signed-off-by: Johannes Schindelin <johannes.schinde...@gmx.de>
---
 t/t5520-pull.sh | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 3159956..b281d6f 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -255,6 +255,36 @@ test_expect_success '--rebase' '
        test new = "$(git show HEAD:file2)"
 '
 
+test_expect_success '--rebase with conflicts shows advice' '
+       test_when_finished "git rebase --abort; git checkout -f to-rebase" &&
+       git checkout -b seq &&
+       printf "1\\n2\\n3\\n4\\n5\\n" >seq.txt &&
+       git add seq.txt &&
+       test_tick &&
+       git commit -m "Add seq.txt" &&
+       printf "6\\n" >>seq.txt &&
+       test_tick &&
+       git commit -m "Append to seq.txt" seq.txt &&
+       git checkout -b with-conflicts HEAD^ &&
+       printf "conflicting\\n" >>seq.txt &&
+       test_tick &&
+       git commit -m "Create conflict" seq.txt &&
+       test_must_fail git pull --rebase . seq 2>err >out &&
+       grep "When you have resolved this problem" out
+'
+test_expect_success 'failed --rebase shows advice' '
+       test_when_finished "git rebase --abort; git checkout -f to-rebase" &&
+       git checkout -b diverging &&
+       test_commit attributes .gitattributes "* text=auto" attrs &&
+       sha1="$(printf "1\\r\\n" | git hash-object -w --stdin)" &&
+       git update-index --cacheinfo 0644 $sha1 file &&
+       git commit -m v1-with-cr &&
+       git checkout -f -b fails-to-rebase HEAD^ &&
+       test_commit v2-without-cr file "2" file2-lf &&
+       test_must_fail git pull --rebase . diverging 2>err >out &&
+       grep "When you have resolved this problem" out
+'
+
 test_expect_success '--rebase fails with multiple branches' '
        git reset --hard before-rebase &&
        test_must_fail git pull --rebase . copy master 2>err &&
-- 
2.9.0.280.g32e2a70


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to