summaryrefslogtreecommitdiff
path: root/t/t4108-apply-threeway.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-05-10 13:56:49 -0700
committerJunio C Hamano <gitster@pobox.com>2012-07-09 14:40:03 -0700
commitf2633ebd766b7f5817ae0ec69060170bb9b1501f (patch)
treec3139aeef3df05f44d0b1039c5e66e35f25ddf27 /t/t4108-apply-threeway.sh
parent4f4a6cb9882516d75f345772c9bf00b891753f10 (diff)
downloadgit-f2633ebd766b7f5817ae0ec69060170bb9b1501f.tar.gz
apply: allow rerere() to work on --3way results
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4108-apply-threeway.sh')
-rwxr-xr-xt/t4108-apply-threeway.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh
index 475dfb57ee..e6d4da63b2 100755
--- a/t/t4108-apply-threeway.sh
+++ b/t/t4108-apply-threeway.sh
@@ -75,4 +75,29 @@ test_expect_success 'apply with --3way' '
test_cmp expect.diff actual.diff
'
+test_expect_success 'apply with --3way with rerere enabled' '
+ git config rerere.enabled true &&
+
+ # Merging side should be similar to applying this patch
+ git diff ...side >P.diff &&
+
+ # The corresponding conflicted merge
+ git reset --hard &&
+ git checkout master^0 &&
+ test_must_fail git merge --no-commit side &&
+
+ # Manually resolve and record the resolution
+ create_file 1 two 3 4 five six 7 >one &&
+ git rerere &&
+ cat one >expect &&
+
+ # should fail to apply
+ git reset --hard &&
+ git checkout master^0 &&
+ test_must_fail git apply --index --3way P.diff &&
+
+ # but rerere should have replayed the recorded resolution
+ test_cmp expect one
+'
+
test_done