X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4015-diff-whitespace.sh;h=a8736f7cbeef65b3454847bb4b4df508c0079652;hb=37ad7ca7dbb0bef2b902f6bc7d3346ddff1667a5;hp=935d101fe8d880ff426452ca6f611ce8d30b8bc1;hpb=d3fd3d1f9bbb454864bd004dc3f29f99e4087889;p=git.git diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh index 935d101fe..a8736f7cb 100755 --- a/t/t4015-diff-whitespace.sh +++ b/t/t4015-diff-whitespace.sh @@ -491,4 +491,41 @@ test_expect_success 'combined diff with autocrlf conversion' ' ' +# Start testing the colored format for whitespace checks + +test_expect_success 'setup diff colors' ' + git config color.diff always && + git config color.diff.plain normal && + git config color.diff.meta bold && + git config color.diff.frag cyan && + git config color.diff.func normal && + git config color.diff.old red && + git config color.diff.new green && + git config color.diff.commit yellow && + git config color.diff.whitespace "normal red" && + + git config core.autocrlf false +' +cat >expected <<\EOF +diff --git a/x b/x +index 9daeafb..2874b91 100644 +--- a/x ++++ b/x +@@ -1 +1,4 @@ + test ++{ ++ ++} +EOF + +test_expect_success 'diff that introduces a line with only tabs' ' + git config core.whitespace blank-at-eol && + git reset --hard && + echo "test" > x && + git commit -m "initial" x && + echo "{NTN}" | tr "NT" "\n\t" >> x && + git -c color.diff=always diff | test_decode_color >current && + test_cmp expected current +' + test_done