]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t7609-merge-co-error-msgs.sh
Merge branch 'maint'
[git.git] / t / t7609-merge-co-error-msgs.sh
index 1a109b41dc6d538490d62dd9421fd1aea0c9eb7f..c994836c53224dd0a8302f7a6ab63b35f8b493e3 100755 (executable)
@@ -27,23 +27,31 @@ test_expect_success 'setup' '
 
 cat >expect <<\EOF
 error: The following untracked working tree files would be overwritten by merge:
-       two
-       three
-       four
        five
+       four
+       three
+       two
 Please move or remove them before you can merge.
 EOF
 
-test_expect_success 'untracked files overwritten by merge' '
+test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '
        test_must_fail git merge branch 2>out &&
-       test_cmp out expect
+       test_cmp out expect &&
+       git commit --allow-empty -m empty &&
+       (
+               GIT_MERGE_VERBOSITY=0 &&
+               export GIT_MERGE_VERBOSITY &&
+               test_must_fail git merge branch 2>out2
+       ) &&
+       test_cmp out2 expect &&
+       git reset --hard HEAD^
 '
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by merge:
-       two
-       three
        four
+       three
+       two
 Please, commit your changes or stash them before you can merge.
 error: The following untracked working tree files would be overwritten by merge:
        five
@@ -60,8 +68,8 @@ test_expect_success 'untracked files or local changes ovewritten by merge' '
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by checkout:
-       rep/two
        rep/one
+       rep/two
 Please, commit your changes or stash them before you can switch branches.
 EOF
 
@@ -81,8 +89,8 @@ test_expect_success 'cannot switch branches because of local changes' '
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by checkout:
-       rep/two
        rep/one
+       rep/two
 Please, commit your changes or stash them before you can switch branches.
 EOF
 
@@ -94,8 +102,8 @@ test_expect_success 'not uptodate file porcelain checkout error' '
 
 cat >expect <<\EOF
 error: Updating the following directories would lose untracked files in it:
-       rep2
        rep
+       rep2
 
 EOF