diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-04-03 13:01:09 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-03 13:01:09 -0700 |
| commit | fed877c9e16077fa43757fe4a264228aef4b907e (patch) | |
| tree | 013dbabaf635b1395c7213367ea082d2849cd0cc | |
| parent | e0613d24f9902a581b6a1cf0aa39b517db1e3f2f (diff) | |
| parent | 699248d89e8e226cb228647a980449f8aadf03f0 (diff) | |
| download | git-fed877c9e16077fa43757fe4a264228aef4b907e.tar.xz | |
Merge branch 'th/t8003-unhide-git-failures'
Test clean-up.
* th/t8003-unhide-git-failures:
t8003: modernise style
t8003: avoid suppressing git's exit code
| -rwxr-xr-x | t/t8003-blame-corner-cases.sh | 75 |
1 files changed, 31 insertions, 44 deletions
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh index 731265541a..30e7960ace 100755 --- a/t/t8003-blame-corner-cases.sh +++ b/t/t8003-blame-corner-cases.sh @@ -49,80 +49,69 @@ test_expect_success setup ' ' test_expect_success 'straight copy without -C' ' - - git blame uno | grep Second - + git blame uno >actual && + test_grep Second actual ' test_expect_success 'straight move without -C' ' - - git blame dos | grep Initial - + git blame dos >actual && + test_grep Initial actual ' test_expect_success 'straight copy with -C' ' - - git blame -C1 uno | grep Second - + git blame -C1 uno >actual && + test_grep Second actual ' test_expect_success 'straight move with -C' ' - - git blame -C1 dos | grep Initial - + git blame -C1 dos >actual && + test_grep Initial actual ' test_expect_success 'straight copy with -C -C' ' - - git blame -C -C1 uno | grep Initial - + git blame -C -C1 uno >actual && + test_grep Initial actual ' test_expect_success 'straight move with -C -C' ' - - git blame -C -C1 dos | grep Initial - + git blame -C -C1 dos >actual && + test_grep Initial actual ' test_expect_success 'append without -C' ' - - git blame -L2 tres | grep Second - + git blame -L2 tres >actual && + test_grep Second actual ' test_expect_success 'append with -C' ' - - git blame -L2 -C1 tres | grep Second - + git blame -L2 -C1 tres >actual && + test_grep Second actual ' test_expect_success 'append with -C -C' ' - - git blame -L2 -C -C1 tres | grep Second - + git blame -L2 -C -C1 tres >actual && + test_grep Second actual ' test_expect_success 'append with -C -C -C' ' - - git blame -L2 -C -C -C1 tres | grep Initial - + git blame -L2 -C -C -C1 tres >actual && + test_grep Initial actual ' test_expect_success 'blame wholesale copy' ' - - git blame -f -C -C1 HEAD^ -- cow | sed -e "$pick_fc" >current && + git blame -f -C -C1 HEAD^ -- cow >actual && + sed -e "$pick_fc" actual >current && cat >expected <<-\EOF && mouse-Initial mouse-Second mouse-Third EOF test_cmp expected current - ' test_expect_success 'blame wholesale copy and more' ' - - git blame -f -C -C1 HEAD -- cow | sed -e "$pick_fc" >current && + git blame -f -C -C1 HEAD -- cow >actual && + sed -e "$pick_fc" actual >current && cat >expected <<-\EOF && mouse-Initial mouse-Second @@ -130,11 +119,9 @@ test_expect_success 'blame wholesale copy and more' ' mouse-Third EOF test_cmp expected current - ' test_expect_success 'blame wholesale copy and more in the index' ' - cat >horse <<-\EOF && ABC DEF @@ -144,7 +131,8 @@ test_expect_success 'blame wholesale copy and more in the index' ' EOF git add horse && test_when_finished "git rm -f horse" && - git blame -f -C -C1 -- horse | sed -e "$pick_fc" >current && + git blame -f -C -C1 -- horse >actual && + sed -e "$pick_fc" actual >current && cat >expected <<-\EOF && mouse-Initial mouse-Second @@ -153,11 +141,9 @@ test_expect_success 'blame wholesale copy and more in the index' ' mouse-Third EOF test_cmp expected current - ' test_expect_success 'blame during cherry-pick with file rename conflict' ' - test_when_finished "git reset --hard && git checkout main" && git checkout HEAD~3 && echo MOUSE >> mouse && @@ -168,7 +154,8 @@ test_expect_success 'blame during cherry-pick with file rename conflict' ' (git cherry-pick HEAD@{1} || test $? -eq 1) && git show HEAD@{1}:rodent > rodent && git add rodent && - git blame -f -C -C1 rodent | sed -e "$pick_fc" >current && + git blame -f -C -C1 rodent >actual && + sed -e "$pick_fc" actual >current && cat >expected <<-\EOF && mouse-Initial mouse-Second @@ -246,14 +233,14 @@ test_expect_success 'setup file with CRLF newlines' ' 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_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 + test_grep "A U Thor" actual ' test_expect_success 'blame file with CRLF core.autocrlf=true' ' @@ -267,7 +254,7 @@ test_expect_success 'blame file with CRLF core.autocrlf=true' ' git checkout crlfinrepo && rm tmp && git blame crlfinrepo >actual && - grep "A U Thor" actual + test_grep "A U Thor" actual ' test_expect_success 'setup coalesce tests' ' |
