diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2009-03-21 12:42:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-22 15:03:59 -0700 |
commit | 4e218f54b3de6aa8ef7d15020c4507031a519f7d (patch) | |
tree | 3280cc6ead1fe0711924b236362724c7641e884c /t | |
parent | a95148dea1d9546e96adef7c3cad11be80aa30f5 (diff) | |
download | git-4e218f54b3de6aa8ef7d15020c4507031a519f7d.tar.gz |
Smudge the files fed to external diff and textconv
When preparing temporary files for an external diff or textconv, it is
easier on the external tools, especially when they are implemented using
platform tools, if they are fed the input after convert_to_working_tree().
This fixes msysGit issue 177.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t4020-diff-external.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh index 281680d95a..f8c99f1a98 100755 --- a/t/t4020-diff-external.sh +++ b/t/t4020-diff-external.sh @@ -136,4 +136,20 @@ test_expect_success 'GIT_EXTERNAL_DIFF with more than one changed files' ' GIT_EXTERNAL_DIFF=echo git diff ' +echo "#!$SHELL_PATH" >fake-diff.sh +cat >> fake-diff.sh <<\EOF +cat $2 >> crlfed.txt +EOF +chmod a+x fake-diff.sh + +keep_only_cr () { + tr -dc '\015' +} + +test_expect_success 'external diff with autocrlf = true' ' + git config core.autocrlf true && + GIT_EXTERNAL_DIFF=./fake-diff.sh git diff && + test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c) +' + test_done |