aboutsummaryrefslogtreecommitdiff
path: root/t/t4020-diff-external.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-05-31 01:35:52 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-31 17:57:59 -0700
commit003b33a8ad686ee4a0d0b36635bfd6aba940b24a (patch)
treea4fb990bc62930d859f8343c41f5a3162aca6449 /t/t4020-diff-external.sh
parente1c068869216c8c231c1585bbfa9fda42b4756f8 (diff)
downloadgit-003b33a8ad686ee4a0d0b36635bfd6aba940b24a.tar.gz
git-003b33a8ad686ee4a0d0b36635bfd6aba940b24a.tar.xz
diff: generate pretty filenames in prep_temp_blob()
Naturally, prep_temp_blob() did not care about filenames. As a result, GIT_EXTERNAL_DIFF and textconv generated filenames such as ".diff_XXXXXX". This modifies prep_temp_blob() to generate user-friendly filenames when creating temporary files. Diffing "name.ext" now generates "XXXXXX_name.ext". Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4020-diff-external.sh')
-rwxr-xr-xt/t4020-diff-external.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index 072000128..4ea42e00d 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -136,6 +136,15 @@ test_expect_success 'GIT_EXTERNAL_DIFF with more than one changed files' '
GIT_EXTERNAL_DIFF=echo git diff
'
+test_expect_success 'GIT_EXTERNAL_DIFF generates pretty paths' '
+ touch file.ext &&
+ git add file.ext &&
+ echo with extension > file.ext &&
+ GIT_EXTERNAL_DIFF=echo git diff file.ext | grep ......_file\.ext &&
+ git update-index --force-remove file.ext &&
+ rm file.ext
+'
+
echo "#!$SHELL_PATH" >fake-diff.sh
cat >> fake-diff.sh <<\EOF
cat $2 >> crlfed.txt