Skip to content

Commit 688684e

Browse files
davvidgitster
authored andcommitted
t7610-mergetool: add test cases for mergetool.writeToTemp
Add tests to ensure that filenames start with "./" when mergetool.writeToTemp is false and do not start with "./" when mergetool.writeToTemp is true. Signed-off-by: David Aguilar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8f0cb41 commit 688684e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

t/t7610-mergetool.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,27 @@ test_expect_success 'custom commands override built-ins' '
514514
git reset --hard master >/dev/null 2>&1
515515
'
516516

517+
test_expect_success 'filenames seen by tools start with ./' '
518+
git checkout -b test15 branch1 &&
519+
test_config mergetool.writeToTemp false &&
520+
test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
521+
test_config mergetool.myecho.trustExitCode true &&
522+
test_must_fail git merge master &&
523+
git mergetool --no-prompt --tool myecho -- both >actual &&
524+
grep ^\./both_LOCAL_ actual >/dev/null &&
525+
git reset --hard master >/dev/null 2>&1
526+
'
527+
528+
test_expect_success 'temporary filenames are used with mergetool.writeToTemp' '
529+
git checkout -b test16 branch1 &&
530+
test_config mergetool.writeToTemp true &&
531+
test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
532+
test_config mergetool.myecho.trustExitCode true &&
533+
test_must_fail git merge master &&
534+
git mergetool --no-prompt --tool myecho -- both >actual &&
535+
test_must_fail grep ^\./both_LOCAL_ actual >/dev/null &&
536+
grep /both_LOCAL_ actual >/dev/null &&
537+
git reset --hard master >/dev/null 2>&1
538+
'
539+
517540
test_done

0 commit comments

Comments
 (0)