3 test_description
='git merge and other operations that rely on merge
5 Testing the influence of the diff algorithm on the merge output.'
7 TEST_PASSES_SANITIZE_LEAK
=true
10 test_expect_success
'setup' '
11 cp "$TEST_DIRECTORY"/t7615/base.c file.c &&
15 cp "$TEST_DIRECTORY"/t7615/ours.c file.c &&
19 git reset --hard c0 &&
20 cp "$TEST_DIRECTORY"/t7615/theirs.c file.c &&
26 GIT_TEST_MERGE_ALGORITHM
=recursive
28 test_expect_success
'merge c2 to c1 with recursive merge strategy fails with the current default myers diff algorithm' '
29 git reset --hard c1 &&
30 test_must_fail git merge -s recursive c2
33 test_expect_success
'merge c2 to c1 with recursive merge strategy succeeds with -Xdiff-algorithm=histogram' '
34 git reset --hard c1 &&
35 git merge --strategy recursive -Xdiff-algorithm=histogram c2
38 test_expect_success
'merge c2 to c1 with recursive merge strategy succeeds with diff.algorithm = histogram' '
39 git reset --hard c1 &&
40 git config diff.algorithm histogram &&
41 git merge --strategy recursive c2
44 test_expect_success
'cherry-pick c2 to c1 with recursive merge strategy fails with the current default myers diff algorithm' '
45 git reset --hard c1 &&
46 test_must_fail git cherry-pick -s recursive c2
49 test_expect_success
'cherry-pick c2 to c1 with recursive merge strategy succeeds with -Xdiff-algorithm=histogram' '
50 git reset --hard c1 &&
51 git cherry-pick --strategy recursive -Xdiff-algorithm=histogram c2
54 test_expect_success
'cherry-pick c2 to c1 with recursive merge strategy succeeds with diff.algorithm = histogram' '
55 git reset --hard c1 &&
56 git config diff.algorithm histogram &&
57 git cherry-pick --strategy recursive c2