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 <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar committed
Oct 15, 2014 at 01:35 UTC
688684eba436c021eaddab1725093bb953cf260d
1 file changed
+23
t/t7610-mergetool.sh
+23
@@ -514,4 +514,27 @@ test_expect_success 'custom commands override built-ins' '
514
git reset --hard master >/dev/null 2>&1
515
'
516
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
+
540
test_done