summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-03-14 11:25:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-18 02:48:19 (GMT)
commit20de316e33446f37200e51aa333ba7d824dfd478 (patch)
treed9a485cf00354fa2442b196a69003554b9bb2a19 /t/t7800-difftool.sh
parent1a85b49b87af0e17a503b94df10d0b39472ad5b8 (diff)
downloadgit-20de316e33446f37200e51aa333ba7d824dfd478.zip
git-20de316e33446f37200e51aa333ba7d824dfd478.tar.gz
git-20de316e33446f37200e51aa333ba7d824dfd478.tar.bz2
difftool: allow running outside Git worktrees with --no-index
As far as this developer can tell, the conversion from a Perl script to a built-in caused the regression in the difftool that it no longer runs outside of a Git worktree (with `--no-index`, of course). It is a bit embarrassing that it took over two years after retiring the Perl version to discover this regression, but at least we now know, and can do something, about it. This fixes https://github.com/git-for-windows/git/issues/2123 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index bb9a7f4..480dd06 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -705,4 +705,14 @@ test_expect_success SYMLINKS 'difftool --dir-diff handles modified symlinks' '
test_cmp expect actual
'
+test_expect_success 'outside worktree' '
+ echo 1 >1 &&
+ echo 2 >2 &&
+ test_expect_code 1 nongit git \
+ -c diff.tool=echo -c difftool.echo.cmd="echo \$LOCAL \$REMOTE" \
+ difftool --no-prompt --no-index ../1 ../2 >actual &&
+ echo "../1 ../2" >expect &&
+ test_cmp expect actual
+'
+
test_done