diff options
Diffstat (limited to 't/t8003-blame-corner-cases.sh')
-rwxr-xr-x | t/t8003-blame-corner-cases.sh | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh index 2a3469bcbe..16f1442c1e 100755 --- a/t/t8003-blame-corner-cases.sh +++ b/t/t8003-blame-corner-cases.sh @@ -26,7 +26,7 @@ test_expect_success setup ' cat one >uno && mv two dos && cat one >>tres && - echo DEF >>mouse + echo DEF >>mouse && git add uno dos tres mouse && test_tick && GIT_AUTHOR_NAME=Second git commit -a -m Second && @@ -153,15 +153,15 @@ test_expect_success 'blame path that used to be a directory' ' ' test_expect_success 'blame to a commit with no author name' ' - TREE=`git rev-parse HEAD:` - cat >badcommit <<EOF + TREE=`git rev-parse HEAD:` && + cat >badcommit <<EOF && tree $TREE author <noname> 1234567890 +0000 committer David Reiss <dreiss@facebook.com> 1234567890 +0000 some message EOF - COMMIT=`git hash-object -t commit -w badcommit` + COMMIT=`git hash-object -t commit -w badcommit` && git --no-pager blame $COMMIT -- uno >/dev/null ' @@ -191,12 +191,24 @@ test_expect_success 'indent of line numbers, ten lines' ' test $(grep -c " " actual) = 9 ' -test_expect_success 'blaming files with CRLF newlines' ' +test_expect_success 'setup file with CRLF newlines' ' git config core.autocrlf false && - printf "testcase\r\n" >crlffile && + printf "testcase\n" >crlffile && git add crlffile && git commit -m testcase && - git -c core.autocrlf=input blame crlffile >actual && + printf "testcase\r\n" >crlffile +' + +test_expect_success 'blame file with CRLF core.autocrlf true' ' + git config core.autocrlf true && + git blame crlffile >actual && + grep "A U Thor" actual +' + +test_expect_success 'blame file with CRLF attributes text' ' + git config core.autocrlf false && + echo "crlffile text" >.gitattributes && + git blame crlffile >actual && grep "A U Thor" actual ' |