diff options
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-x | t/t7600-merge.sh | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index b2c1d861dc..c773e30b3f 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -122,6 +122,8 @@ test_expect_success 'setup' ' c0=$(git rev-parse HEAD) && cp file.1 file && git add file && + cp file.1 other && + git add other && test_tick && git commit -m "commit 1" && git tag c1 && @@ -272,7 +274,7 @@ test_expect_success 'merge c3 with c7 with commit.cleanup = scissors' ' EOF git cat-file commit HEAD >raw && sed -e "1,/^$/d" raw >actual && - test_i18ncmp expect actual + test_cmp expect actual ' test_expect_success 'merge c3 with c7 with --squash commit.cleanup = scissors' ' @@ -296,7 +298,7 @@ test_expect_success 'merge c3 with c7 with --squash commit.cleanup = scissors' ' EOF git cat-file commit HEAD >raw && sed -e "1,/^$/d" raw >actual && - test_i18ncmp expect actual + test_cmp expect actual ' test_debug 'git log --graph --decorate --oneline --all' @@ -711,6 +713,16 @@ test_expect_success 'fast-forward merge with --autostash' ' test_cmp result.1-5 file ' +test_expect_success 'failed fast-forward merge with --autostash' ' + git reset --hard c0 && + git merge-file file file.orig file.5 && + cp file.5 other && + test_when_finished "rm other" && + test_must_fail git merge --autostash c1 2>err && + test_i18ngrep "Applied autostash." err && + test_cmp file.5 file +' + test_expect_success 'octopus merge with --autostash' ' git reset --hard c1 && git merge-file file file.orig file.3 && @@ -721,6 +733,14 @@ test_expect_success 'octopus merge with --autostash' ' test_cmp result.1-3-5-9 file ' +test_expect_success 'failed merge (exit 2) with --autostash' ' + git reset --hard c1 && + git merge-file file file.orig file.5 && + test_must_fail git merge -s recursive --autostash c2 c3 2>err && + test_i18ngrep "Applied autostash." err && + test_cmp result.1-5 file +' + test_expect_success 'conflicted merge with --autostash, --abort restores stash' ' git reset --hard c3 && cp file.1 file && |