X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7609-merge-co-error-msgs.sh;h=114d2bd7855f71ec1d48f2017438f897c5255d36;hb=f3bb8b4b8452f1b7add220e787ef56c737ceff6a;hp=1a109b41dc6d538490d62dd9421fd1aea0c9eb7f;hpb=5cba1229d8246da2a6d1d956eeed8227f69e185b;p=git.git diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh index 1a109b41d..c994836c5 100755 --- a/t/t7609-merge-co-error-msgs.sh +++ b/t/t7609-merge-co-error-msgs.sh @@ -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