X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft4002-diff-basic.sh;h=73441a516572dcf826582c04f3fe9d3ad0c1a88c;hb=48c250a121a425a1860226b6a7061aecfbab5246;hp=cc3681f16118ca70ae9f65a27ccd6f354a6deee1;hpb=c3067cbfb3fbab32177d5f61ea73127f08ab43cb;p=git.git diff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh index cc3681f16..73441a516 100755 --- a/t/t4002-diff-basic.sh +++ b/t/t4002-diff-basic.sh @@ -135,7 +135,7 @@ cmp_diff_files_output () { # filesystem. sed <"$2" >.test-tmp \ -e '/^:000000 /d;s/'$x40'\( [MCRNDU][0-9]*\) /'$z40'\1 /' && - diff "$1" .test-tmp + test_cmp "$1" .test-tmp } test_expect_success \ @@ -258,4 +258,12 @@ test_expect_success \ git diff-tree -r -R $tree_A $tree_B >.test-b && cmp -s .test-a .test-b' +test_expect_success \ + 'diff can read from stdin' \ + 'test_must_fail git diff --no-index -- MN - < NN | + grep -v "^index" | sed "s#/-#/NN#" >.test-a && + test_must_fail git diff --no-index -- MN NN | + grep -v "^index" >.test-b && + test_cmp .test-a .test-b' + test_done