From b9ebb659268ae1ecf742dff6261e87f4ee57dde7 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 10 Jan 2017 15:42:00 -0500 Subject: 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 Signed-off-by: Junio C Hamano --- t/t7610-mergetool.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 't') 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 && -- cgit v1.2.1