summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2013-05-17 18:26:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-17 18:46:53 (GMT)
commit1f197a1de497db8898c9920fab77533dab34a03c (patch)
tree84de54dd5e8c42b3351e515ad6ec2b1702e2557d /t/t7800-difftool.sh
parent31eb360b43ec351b97adcf67e07fb748da574aaa (diff)
downloadgit-1f197a1de497db8898c9920fab77533dab34a03c.zip
git-1f197a1de497db8898c9920fab77533dab34a03c.tar.gz
git-1f197a1de497db8898c9920fab77533dab34a03c.tar.bz2
difftool: fix dir-diff when file does not exist in working tree
Commit 02c5631 (difftool --dir-diff: symlink all files matching the working tree, 2013-03-14) does not handle the case where a file that is being compared does not exist in the working tree. Fix this by checking for existence explicitly before running git-hash-object. Reported-by: Kevin Bracey <kevin@bracey.fi> Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index a6bd99e..d46f041 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -356,6 +356,13 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory' '
)
'
+run_dir_diff_test 'difftool --dir-diff when worktree file is missing' '
+ test_when_finished git reset --hard &&
+ rm file2 &&
+ git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
+ grep file2 output
+'
+
write_script .git/CHECK_SYMLINKS <<\EOF
for f in file file2 sub/sub
do