diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-09-03 14:14:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-03 14:14:01 -0700 |
commit | 7662973ea38e39f2766a4403209189f263c914a3 (patch) | |
tree | 38d64a67067ae465a32e50e3b998c7d84c29c2fc /t | |
parent | 16ffa6443e279a9b3b63d7a2bebeb07833506010 (diff) | |
parent | 9dd330e6cad6ce11557acb18f35136c549d8ac1b (diff) | |
download | git-7662973ea38e39f2766a4403209189f263c914a3.tar.gz |
Merge branch 'jk/am-rerere-lock-fix'
Recent "git am" introduced a double-locking failure when used with
the "--3way" option that invokes rerere machinery.
* jk/am-rerere-lock-fix:
rerere: release lockfile in non-writing functions
Diffstat (limited to 't')
-rwxr-xr-x | t/t4150-am.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t4150-am.sh b/t/t4150-am.sh index dd627c42d3..af6053a242 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -873,4 +873,40 @@ test_expect_success 'am --message-id -s signs off after the message id' ' test_cmp expected actual ' +test_expect_success 'am -3 works with rerere' ' + rm -fr .git/rebase-apply && + git reset --hard && + + # make patches one->two and two->three... + test_commit one file && + test_commit two file && + test_commit three file && + git format-patch -2 --stdout >seq.patch && + + # and create a situation that conflicts... + git reset --hard one && + test_commit other file && + + # enable rerere... + test_config rerere.enabled true && + test_when_finished "rm -rf .git/rr-cache" && + + # ...and apply. Our resolution is to skip the first + # patch, and the rerere the second one. + test_must_fail git am -3 seq.patch && + test_must_fail git am --skip && + echo resolved >file && + git add file && + git am --resolved && + + # now apply again, and confirm that rerere engaged (we still + # expect failure from am because rerere does not auto-commit + # for us). + git reset --hard other && + test_must_fail git am -3 seq.patch && + test_must_fail git am --skip && + echo resolved >expect && + test_cmp expect file +' + test_done |