From: Junio C Hamano Date: Mon, 27 Aug 2018 21:33:46 +0000 (-0700) Subject: Merge branch 'sg/t0020-conversion-fix' X-Git-Tag: v2.19.0-rc1~11 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/df19317f4f8d8bf699556d594f79d9a6de83a769?ds=inline;hp=-c Merge branch 'sg/t0020-conversion-fix' Test fixes. * sg/t0020-conversion-fix: t0020-crlf: check the right file --- df19317f4f8d8bf699556d594f79d9a6de83a769 diff --combined t/t0020-crlf.sh index 5f056982a5,f7a6a3ce7d..854da0ae16 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@@ -35,7 -35,9 +35,7 @@@ test_expect_success setup for w in Some extra lines here; do echo $w; done >>one && git diff >patch.file && patched=$(git hash-object --stdin doublewarn && - test $(git add doublewarn 2>&1 | grep "CRLF will be replaced by LF" | wc -l) = 1 + git add doublewarn 2>err && + if test_have_prereq C_LOCALE_OUTPUT + then + test $(grep "CRLF will be replaced by LF" err | wc -l) = 1 + fi ' @@@ -98,16 -96,6 +98,16 @@@ test_expect_success 'safecrlf: git dif ' +test_expect_success 'safecrlf: no warning with safecrlf=false' ' + git config core.autocrlf input && + git config core.safecrlf false && + + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf && + git add allcrlf 2>err && + test_must_be_empty err +' + + test_expect_success 'switch off autocrlf, safecrlf, reset HEAD' ' git config core.autocrlf false && git config core.safecrlf false && @@@ -160,7 -148,7 +160,7 @@@ test_expect_success 'checkout with auto git config core.autocrlf input && git read-tree --reset -u HEAD && test_must_fail has_cr one && - test_must_fail has_cr two && + test_must_fail has_cr dir/two && git update-index -- one dir/two && test "$one" = $(git hash-object --stdin .gitattributes && git read-tree --reset -u HEAD && - if has_cr dir/two - then - echo "Huh?" - false - else - : happy - fi + test_must_fail has_cr dir/two ' test_expect_success '.gitattributes says two and three are text' '