diff options
Diffstat (limited to 't/t7607-merge-overwrite.sh')
-rwxr-xr-x | t/t7607-merge-overwrite.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh index 758a623cdb..dd8ab7ede1 100755 --- a/t/t7607-merge-overwrite.sh +++ b/t/t7607-merge-overwrite.sh @@ -92,12 +92,15 @@ test_expect_success 'will not overwrite removed file with staged changes' ' test_cmp important c1.c ' -test_expect_failure 'will not overwrite unstaged changes in renamed file' ' +test_expect_success 'will not overwrite unstaged changes in renamed file' ' git reset --hard c1 && git mv c1.c other.c && git commit -m rename && cp important other.c && - git merge c1a && + test_must_fail git merge c1a >out && + test_i18ngrep "Refusing to lose dirty file at other.c" out && + test_path_is_file other.c~HEAD && + test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) && test_cmp important other.c ' @@ -115,7 +118,7 @@ cat >expect <<\EOF error: The following untracked working tree files would be overwritten by merge: sub sub2 -Please move or remove them before you can merge. +Please move or remove them before you merge. Aborting EOF @@ -125,7 +128,7 @@ test_expect_success 'will not overwrite untracked file in leading path' ' cp important sub && cp important sub2 && test_must_fail git merge sub 2>out && - test_cmp out expect && + test_i18ncmp out expect && test_path_is_missing .git/MERGE_HEAD && test_cmp important sub && test_cmp important sub2 && |