X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft4015-diff-whitespace.sh;h=a8736f7cbeef65b3454847bb4b4df508c0079652;hb=cfd1a9849cdb4b9c7fcd0cb71a28cbdbc3494329;hp=935d101fe8d880ff426452ca6f611ce8d30b8bc1;hpb=cf4403a01070f03e5c5cc65b52c1351d20ff4e91;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