summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRichard Hansen <hansenr@google.com>2017-01-10 15:42:00 -0500
committerJunio C Hamano <gitster@pobox.com>2017-01-10 13:22:20 -0800
commitb9ebb659268ae1ecf742dff6261e87f4ee57dde7 (patch)
tree441c118c949bc8f2f54bb6f0aa5fc110551ec478 /t
parentbd9714f2533e8264422811098d0e1b13134094e9 (diff)
downloadgit-b9ebb659268ae1ecf742dff6261e87f4ee57dde7.tar.gz
t7610: add test case for rerere+mergetool+subdir bug
If rerere is enabled and mergetool is run from a subdirectory, mergetool always prints "No files need merging". Add an expected failure test case for this situation. Signed-off-by: Richard Hansen <hansenr@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7610-mergetool.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index de006edf07..ab0b005b28 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -216,7 +216,7 @@ test_expect_success 'mergetool skips autoresolved' '
test "$output" = "No files need merging"
'
-test_expect_success 'mergetool merges all from subdir' '
+test_expect_success 'mergetool merges all from subdir (rerere disabled)' '
test_when_finished "git reset --hard" &&
git checkout -b test$test_count branch1 &&
test_config rerere.enabled false &&
@@ -234,6 +234,25 @@ test_expect_success 'mergetool merges all from subdir' '
)
'
+test_expect_failure 'mergetool merges all from subdir (rerere enabled)' '
+ test_when_finished "git reset --hard" &&
+ git checkout -b test$test_count branch1 &&
+ test_config rerere.enabled true &&
+ rm -rf .git/rr-cache &&
+ (
+ cd subdir &&
+ test_must_fail git merge master &&
+ ( yes "r" | git mergetool ../submod ) &&
+ ( yes "d" "d" | git mergetool --no-prompt ) &&
+ test "$(cat ../file1)" = "master updated" &&
+ test "$(cat ../file2)" = "master new" &&
+ test "$(cat file3)" = "master new sub" &&
+ ( cd .. && git submodule update -N ) &&
+ test "$(cat ../submod/bar)" = "master submodule" &&
+ git commit -m "branch2 resolved by mergetool from subdir"
+ )
+'
+
test_expect_success 'mergetool skips resolved paths when rerere is active' '
test_when_finished "git reset --hard" &&
test_config rerere.enabled true &&