]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t0000-t3999: detect and signal failure within loop
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 9 Dec 2021 05:11:12 +0000 (00:11 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Dec 2021 18:29:48 +0000 (10:29 -0800)
Failures within `for` and `while` loops can go unnoticed if not detected
and signaled manually since the loop itself does not abort when a
contained command fails, nor will a failure necessarily be detected when
the loop finishes since the loop returns the exit code of the last
command it ran on the final iteration, which may not be the command
which failed. Therefore, detect and signal failures manually within
loops using the idiom `|| return 1` (or `|| exit 1` within subshells).

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
31 files changed:
t/perf/p0100-globbing.sh
t/perf/p1400-update-ref.sh
t/perf/p1451-fsck-skip-list.sh
t/perf/p3400-rebase.sh
t/perf/p5302-pack-index.sh
t/perf/p5303-many-packs.sh
t/perf/p7519-fsmonitor.sh
t/t0008-ignores.sh
t/t0011-hashmap.sh
t/t0021-conversion.sh
t/t0095-bloom.sh
t/t0410-partial-clone.sh
t/t1050-large.sh
t/t1091-sparse-checkout-builtin.sh
t/t1300-config.sh
t/t1400-update-ref.sh
t/t1403-show-ref.sh
t/t1410-reflog.sh
t/t1512-rev-parse-disambiguation.sh
t/t2004-checkout-cache-temp.sh
t/t2012-checkout-last.sh
t/t2200-add-update.sh
t/t2203-add-intent.sh
t/t3202-show-branch.sh
t/t3303-notes-subtrees.sh
t/t3305-notes-fanout.sh
t/t3404-rebase-interactive.sh
t/t3501-revert-cherry-pick.sh
t/t3508-cherry-pick-many-commits.sh
t/t3700-add.sh
t/t3920-crlf-messages.sh

index dd18a9ce2b115fbf92a4787f5336cb4c9f549d18..439e9c8e3c6484fe3a6f34a4f5903b07397d0c1f 100755 (executable)
@@ -19,9 +19,9 @@ test_expect_success 'setup' '
                printf "a" >>refname &&
                for j in $(test_seq 1 $i)
                do
-                       printf "a*" >>refglob.$i
+                       printf "a*" >>refglob.$i || return 1
                done &&
-               echo b >>refglob.$i
+               echo b >>refglob.$i || return 1
        done &&
        test_commit test $(cat refname).t "" $(cat refname).t
 '
index dda8a7486634488d65ca30ca6da1e795c4eb3a3a..a75969cbb1571ba5da46438c94397ee2130b9be9 100755 (executable)
@@ -13,7 +13,7 @@ test_expect_success "setup" '
        do
                printf "start\ncreate refs/heads/%d PRE\ncommit\n" $i &&
                printf "start\nupdate refs/heads/%d POST PRE\ncommit\n" $i &&
-               printf "start\ndelete refs/heads/%d POST\ncommit\n" $i
+               printf "start\ndelete refs/heads/%d POST\ncommit\n" $i || return 1
        done >instructions
 '
 
@@ -22,7 +22,7 @@ test_perf "update-ref" '
        do
                git update-ref refs/heads/branch PRE &&
                git update-ref refs/heads/branch POST PRE &&
-               git update-ref -d refs/heads/branch
+               git update-ref -d refs/heads/branch || return 1
        done
 '
 
index c2b97d2487bbcabf3ee1becc7bb8b7c0fb0ac784..f767d834f2ea08fe1415a24b4c20de63decf43e2 100755 (executable)
@@ -15,7 +15,7 @@ test_expect_success "setup $n bad commits" '
                echo "committer C <c@example.com> 1234567890 +0000" &&
                echo "data <<EOF" &&
                echo "$i.Q." &&
-               echo "EOF"
+               echo "EOF" || return 1
        done | q_to_nul | git fast-import
 '
 
index 43d5a34e8cadc8c9284e6586f426de5fa9857a9f..e6b0277729b19631ad49740070b092ff08121972 100755 (executable)
@@ -22,7 +22,7 @@ test_expect_success 'setup rebasing on top of a lot of changes' '
                git add unrelated-file$i &&
                test_tick &&
                git commit -m commit$i-reverse unrelated-file$i ||
-               break
+               return 1
        done &&
        git checkout to-rebase &&
        test_commit our-patch interesting-file
index 654cd9c86e13d0e26eac2470771d104a8075896e..c16f6a3ff698c088db427ae9d7b0a8f16f59a8c6 100755 (executable)
@@ -22,7 +22,7 @@ test_expect_success 'set up thread-counting tests' '
        while test $t -gt 0
        do
                threads="$t $threads" &&
-               t=$((t / 2))
+               t=$((t / 2)) || return 1
        done
 '
 
index 58213fe171f1a4769de6cb41db07c92ff8a837a2..af173a7b73e398c33b5629717cc890ea14a5fa33 100755 (executable)
@@ -130,7 +130,7 @@ test_expect_success 'generate lots of packs' '
                echo "data <<EOF" &&
                echo "blob $i" &&
                echo "EOF" &&
-               echo "checkpoint"
+               echo "checkpoint" || return 1
        done |
        git -c fastimport.unpackLimit=0 fast-import
 '
index 5eb5044a103cabd1d3dba4980a00f0d66d4818a5..c8be58f3c763beb7b890925251300494365b3900 100755 (executable)
@@ -119,10 +119,10 @@ test_expect_success "one time repo setup" '
        fi &&
 
        mkdir 1_file 10_files 100_files 1000_files 10000_files &&
-       for i in $(test_seq 1 10); do touch 10_files/$i; done &&
-       for i in $(test_seq 1 100); do touch 100_files/$i; done &&
-       for i in $(test_seq 1 1000); do touch 1000_files/$i; done &&
-       for i in $(test_seq 1 10000); do touch 10000_files/$i; done &&
+       for i in $(test_seq 1 10); do touch 10_files/$i || return 1; done &&
+       for i in $(test_seq 1 100); do touch 100_files/$i || return 1; done &&
+       for i in $(test_seq 1 1000); do touch 1000_files/$i || return 1; done &&
+       for i in $(test_seq 1 10000); do touch 10000_files/$i || return 1; done &&
        git add 1_file 10_files 100_files 1000_files 10000_files &&
        git commit -qm "Add files" &&
 
index 42d2314804966fae851eb3973310d615d5e1e053..5575dade8eee8184b24d6685213b9a30dcee4364 100755 (executable)
@@ -200,7 +200,7 @@ test_expect_success 'setup' '
        do
                : >$dir/not-ignored &&
                : >$dir/ignored-and-untracked &&
-               : >$dir/ignored-but-in-index
+               : >$dir/ignored-but-in-index || return 1
        done &&
        git add -f ignored-but-in-index a/ignored-but-in-index &&
        cat <<-\EOF >a/.gitignore &&
index e094975b13bf270992d9cac8999bb0972a633198..1cb6aa6824321656264e427f299899acf0754357 100755 (executable)
@@ -220,7 +220,7 @@ test_expect_success 'grow / shrink' '
        for n in $(test_seq 51)
        do
                echo put key$n value$n >> in &&
-               echo NULL >> expect
+               echo NULL >> expect || return 1
        done &&
        echo size >> in &&
        echo 64 51 >> expect &&
@@ -231,7 +231,7 @@ test_expect_success 'grow / shrink' '
        for n in $(test_seq 12)
        do
                echo remove key$n >> in &&
-               echo value$n >> expect
+               echo value$n >> expect || return 1
        done &&
        echo size >> in &&
        echo 256 40 >> expect &&
index bb3de2701ab2ccd509e85f92406f46a8fc43116f..bad37abad2c376182ca0241afcfcb54a3f4f700e 100755 (executable)
@@ -285,7 +285,7 @@ test_expect_success 'required filter with absent smudge field' '
 test_expect_success 'filtering large input to small output should use little memory' '
        test_config filter.devnull.clean "cat >/dev/null" &&
        test_config filter.devnull.required true &&
-       for i in $(test_seq 1 30); do printf "%1048576d" 1; done >30MB &&
+       for i in $(test_seq 1 30); do printf "%1048576d" 1 || return 1; done >30MB &&
        echo "30MB filter=devnull" >.gitattributes &&
        GIT_MMAP_LIMIT=1m GIT_ALLOC_LIMIT=1m git add 30MB
 '
@@ -303,7 +303,7 @@ test_expect_success 'filter that does not read is fine' '
 test_expect_success EXPENSIVE 'filter large file' '
        test_config filter.largefile.smudge cat &&
        test_config filter.largefile.clean cat &&
-       for i in $(test_seq 1 2048); do printf "%1048576d" 1; done >2GB &&
+       for i in $(test_seq 1 2048); do printf "%1048576d" 1 || return 1; done >2GB &&
        echo "2GB filter=largefile" >.gitattributes &&
        git add 2GB 2>err &&
        test_must_be_empty err &&
@@ -643,7 +643,7 @@ test_expect_success PERL 'required process filter should process multiple packet
                for FILE in "$TEST_ROOT"/*.file
                do
                        cp "$FILE" . &&
-                       rot13.sh <"$FILE" >"$FILE.rot13"
+                       rot13.sh <"$FILE" >"$FILE.rot13" || return 1
                done &&
 
                echo "*.file filter=protocol" >.gitattributes &&
@@ -682,7 +682,7 @@ test_expect_success PERL 'required process filter should process multiple packet
 
                for FILE in *.file
                do
-                       test_cmp_committed_rot13 "$TEST_ROOT/$FILE" $FILE
+                       test_cmp_committed_rot13 "$TEST_ROOT/$FILE" $FILE || return 1
                done
        )
 '
index 7e4ab1795fb99890d5adb8b67ebf2d82042de3e5..5945973552a6af6ac1971920b573086b081f6160 100755 (executable)
@@ -84,7 +84,7 @@ test_expect_success 'get bloom filter for commit with 10 changes' '
        mkdir smallDir &&
        for i in $(test_seq 0 9)
        do
-               echo $i >smallDir/$i
+               echo $i >smallDir/$i || return 1
        done &&
        git add smallDir &&
        git commit -m "commit with 10 changes" &&
@@ -102,7 +102,7 @@ test_expect_success EXPENSIVE 'get bloom filter for commit with 513 changes' '
        mkdir bigDir &&
        for i in $(test_seq 0 511)
        do
-               echo $i >bigDir/$i
+               echo $i >bigDir/$i || return 1
        done &&
        git add bigDir &&
        git commit -m "commit with 513 changes" &&
index c76485b1b60fe3292fdc55d99fe5c576660dffb9..f17abd298c83467b3ead07ff87c08623ff640502 100755 (executable)
@@ -469,7 +469,7 @@ test_expect_success 'rev-list dies for missing objects on cmd line' '
                git -C repo rev-list --ignore-missing --objects \
                        --exclude-promisor-objects "$OBJ" &&
                git -C repo rev-list --ignore-missing --objects-edge-aggressive \
-                       --exclude-promisor-objects "$OBJ"
+                       --exclude-promisor-objects "$OBJ" || return 1
        done
 '
 
index 0e4267c72385654d6751c07ccb79ee3e98333575..4f3aa17c994240173fdb4de70da62611700e11fd 100755 (executable)
@@ -105,7 +105,7 @@ test_expect_success 'packsize limit' '
                count=0 &&
                for pi in .git/objects/pack/pack-*.idx
                do
-                       test_path_is_file "$pi" && count=$(( $count + 1 ))
+                       test_path_is_file "$pi" && count=$(( $count + 1 )) || return 1
                done &&
                test $count = 2 &&
 
@@ -118,7 +118,7 @@ test_expect_success 'packsize limit' '
 
                for pi in .git/objects/pack/pack-*.idx
                do
-                       git show-index <"$pi"
+                       git show-index <"$pi" || return 1
                done |
                sed -e "s/^[0-9]* \([0-9a-f]*\) .*/\1/" |
                sort >actual &&
index 272ba1b566b3eaf43798f9ecfb1a77c26db3f59b..5d53dbfbde13ceec731836884b07edb3263ee2e2 100755 (executable)
@@ -586,7 +586,7 @@ test_expect_success 'pattern-checks: contained glob characters' '
                !/*/
                something$c-else/
                EOF
-               check_read_tree_errors repo "a" "disabling cone pattern matching"
+               check_read_tree_errors repo "a" "disabling cone pattern matching" || return 1
        done
 '
 
index 516dd8bfa8920b027c7657edb669cf387233d165..50ee5dc82863877f22c9389ea7230a61e8dc8b11 100755 (executable)
@@ -718,7 +718,7 @@ test_expect_success bool '
        for i in 1 2 3 4
        do
            git config --bool --get bool.true$i >>result &&
-           git config --bool --get bool.false$i >>result
+           git config --bool --get bool.false$i >>result || return 1
        done &&
        test_cmp expect result'
 
index 0d4f73acaa87e5f29a6346abb8d1dc6736d41794..bd58c6c89790b81630796f95e207c9779b35a27c 100755 (executable)
@@ -1368,7 +1368,7 @@ test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches
 (
        for i in $(test_seq 33)
        do
-               echo "create refs/heads/$i HEAD"
+               echo "create refs/heads/$i HEAD" || exit 1
        done >large_input &&
        run_with_limited_open_files git update-ref --stdin <large_input &&
        git rev-parse --verify -q refs/heads/33
@@ -1379,7 +1379,7 @@ test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction deleting branches
 (
        for i in $(test_seq 33)
        do
-               echo "delete refs/heads/$i HEAD"
+               echo "delete refs/heads/$i HEAD" || exit 1
        done >large_input &&
        run_with_limited_open_files git update-ref --stdin <large_input &&
        test_must_fail git rev-parse --verify -q refs/heads/33
index bbc01aae344c5dadf6df50cbef3927b690d3a99f..405da58b752b31f8fd970fe8d6e13226a68f394c 100755 (executable)
@@ -123,14 +123,14 @@ test_expect_success 'show-ref -d' '
 test_expect_success 'show-ref --heads, --tags, --head, pattern' '
        for branch in B main side
        do
-               echo $(git rev-parse refs/heads/$branch) refs/heads/$branch
+               echo $(git rev-parse refs/heads/$branch) refs/heads/$branch || return 1
        done >expect.heads &&
        git show-ref --heads >actual &&
        test_cmp expect.heads actual &&
 
        for tag in A B C
        do
-               echo $(git rev-parse refs/tags/$tag) refs/tags/$tag
+               echo $(git rev-parse refs/tags/$tag) refs/tags/$tag || return 1
        done >expect.tags &&
        git show-ref --tags >actual &&
        test_cmp expect.tags actual &&
index d42f067ff8ca0feefcb7cc28a6fc549bd31827bd..d7ddf7612d48363ccbac0a4a80d8399bae7b453f 100755 (executable)
@@ -349,12 +349,12 @@ test_expect_success SHA1 'parsing reverse reflogs at BUFSIZ boundaries' '
                printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" &&
                if test $i = 75; then
                        for j in $(test_seq 1 89); do
-                               printf X
+                               printf X || return 1
                        done
                else
                        printf X
                fi &&
-               printf "\n"
+               printf "\n" || return 1
        done >.git/logs/refs/heads/reflogskip &&
        git rev-parse reflogskip@{73} >actual &&
        echo ${zf}03 >expect &&
index 15188a408bb0e3a381473abf81a01d78ada48e8f..b0119bf8bc8417439bee91bb7c1add21bc460c2e 100755 (executable)
@@ -381,7 +381,7 @@ test_expect_success 'ambiguous commits are printed by type first, then hash orde
        do
                grep $type objects >$type.objects &&
                sort $type.objects >$type.objects.sorted &&
-               test_cmp $type.objects.sorted $type.objects
+               test_cmp $type.objects.sorted $type.objects || return 1
        done
 '
 
index 9bb503a97578c1d43a01409a93e2dd4f7c207a43..b16d69ca4ae0e8b61ce00a085273d8ad6f40f104 100755 (executable)
@@ -57,7 +57,7 @@ test_expect_success 'checkout all stage 0 to temporary files' '
                test $(grep $f actual | cut "-d " -f2) = $f &&
                p=$(grep $f actual | cut "-d    " -f1) &&
                test -f $p &&
-               test $(cat $p) = tree1$f
+               test $(cat $p) = tree1$f || return 1
        done
 '
 
@@ -85,7 +85,7 @@ test_expect_success 'checkout all stage 2 to temporary files' '
                test $(grep $f actual | cut "-d " -f2) = $f &&
                p=$(grep $f actual | cut "-d    " -f1) &&
                test -f $p &&
-               test $(cat $p) = tree2$f
+               test $(cat $p) = tree2$f || return 1
        done
 '
 
index 0e7d47ab318338a211bf444f890176086b9fed5d..42601d5a310de33185c40f928b566a45c9985f1c 100755 (executable)
@@ -49,14 +49,14 @@ test_expect_success '"checkout -" detaches again' '
 test_expect_success 'more switches' '
        for i in 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
        do
-               git checkout -b branch$i
+               git checkout -b branch$i || return 1
        done
 '
 
 more_switches () {
        for i in 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
        do
-               git checkout branch$i
+               git checkout branch$i || return 1
        done
 }
 
index d2ef0041f9515b1cb3aaf674cf73a8dc4fb6c5ff..6993fcbe7a34c174d260b13c9483120cef2a39fd 100755 (executable)
@@ -152,7 +152,7 @@ test_expect_success 'add -u resolves unmerged paths' '
                do
                        echo "100644 $one 1     $path" &&
                        echo "100644 $two 2     $path" &&
-                       echo "100644 $three 3   $path"
+                       echo "100644 $three 3   $path" || return 1
                done &&
                echo "100644 $one 1     path3" &&
                echo "100644 $one 1     path4" &&
index cf0175ad6e414e3a126a205d56a9d910ec173641..db7ca55998666138f3580fe430dfe53ece43be13 100755 (executable)
@@ -116,7 +116,7 @@ test_expect_success 'cache-tree does not ignore dir that has i-t-a entries' '
                mkdir 2 &&
                for f in 1 2/1 2/2 3
                do
-                       echo "$f" >"$f"
+                       echo "$f" >"$f" || return 1
                done &&
                git add 1 2/2 3 &&
                git add -N 2/1 &&
index ad9902a06b9f20d9e4d86b676e30fdd906835e67..1e54a331034f6abf33708de553f5298092a7aa1e 100755 (executable)
@@ -9,7 +9,7 @@ test_expect_success 'setup' '
        for i in $(test_seq 1 10)
        do
                git checkout -b branch$i initial &&
-               test_commit --no-tag branch$i
+               test_commit --no-tag branch$i || return 1
        done &&
        git for-each-ref \
                --sort=version:refname \
@@ -49,7 +49,7 @@ test_expect_success 'show-branch with more than 8 branches' '
 test_expect_success 'show-branch with showbranch.default' '
        for branch in $(cat branches.sorted)
        do
-               test_config showbranch.default $branch --add
+               test_config showbranch.default $branch --add || return 1
        done &&
        git show-branch >actual &&
        test_cmp expect actual
@@ -124,7 +124,7 @@ test_expect_success 'show branch --merge-base with one argument' '
        do
                git rev-parse $branch >expect &&
                git show-branch --merge-base $branch >actual &&
-               test_cmp expect actual
+               test_cmp expect actual || return 1
        done
 '
 
@@ -133,7 +133,7 @@ test_expect_success 'show branch --merge-base with two arguments' '
        do
                git rev-parse initial >expect &&
                git show-branch --merge-base initial $branch >actual &&
-               test_cmp expect actual
+               test_cmp expect actual || return 1
        done
 '
 
index d47ce00f6944951fbc3b9d09ddf701771a13db7d..7ce056e61794e6ef69257c16dc08efa34ea9b001 100755 (executable)
@@ -30,7 +30,7 @@ verify_notes () {
        while [ $i -gt 0 ]; do
                echo "    commit #$i" &&
                echo "    note for commit #$i" &&
-               i=$(($i-1));
+               i=$(($i-1)) || return 1
        done > expect &&
        test_cmp expect output
 }
@@ -42,7 +42,7 @@ test_expect_success "setup: create $number_of_commits commits" '
                while [ $nr -lt $number_of_commits ]; do
                        nr=$(($nr+1)) &&
                        test_tick &&
-                       cat <<INPUT_END
+                       cat <<INPUT_END || return 1
 commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
@@ -178,7 +178,7 @@ verify_concatenated_notes () {
                echo "    first note for commit #$i" &&
                echo "    " &&
                echo "    second note for commit #$i" &&
-               i=$(($i-1));
+               i=$(($i-1)) || return 1
        done > expect &&
        test_cmp expect output
 }
index 94c1b02251c28e68778d8a5c4f1298ec1a84dc52..836b6f22bf645be83590d19878143f04e8c684f0 100755 (executable)
@@ -57,7 +57,7 @@ test_expect_success 'many notes created correctly with git-notes' '
        do
                echo "    commit #$i" &&
                echo "    note #$i" &&
-               i=$(($i - 1));
+               i=$(($i - 1)) || return 1
        done > expect &&
        test_cmp expect output
 '
@@ -106,7 +106,7 @@ test_expect_success 'most notes deleted correctly with git-notes' '
        do
                echo "    commit #$i" &&
                echo "    note #$i" &&
-               i=$(($i - 1));
+               i=$(($i - 1)) || return 1
        done > expect &&
        test_cmp expect output
 '
index 12eb226957676e7a1de02c0c22f629c3dc78ba74..f6a9890d66b2f367a03a2e74547ab1a9dcd7b5a1 100755 (executable)
@@ -826,7 +826,7 @@ test_expect_success 'always cherry-pick with --no-ff' '
        do
                test ! $(git rev-parse HEAD~$p) = $(git rev-parse original-no-ff-branch~$p) &&
                git diff HEAD~$p original-no-ff-branch~$p > out &&
-               test_must_be_empty out
+               test_must_be_empty out || return 1
        done &&
        test_cmp_rev HEAD~3 original-no-ff-branch~3 &&
        git diff HEAD~3 original-no-ff-branch~3 > out &&
@@ -1341,7 +1341,7 @@ test_expect_success 'rebase --continue removes CHERRY_PICK_HEAD' '
                test_seq 5 | sed "s/$double/&&/" >seq &&
                git add seq &&
                test_tick &&
-               git commit -m seq-$double
+               git commit -m seq-$double || return 1
        done &&
        git tag seq-onto &&
        git reset --hard HEAD~2 &&
index 4b5b607673329d30ef71c26f673c36ae0058cc67..8617efaaf1e66f6f5d8246a817085ebd2d43c477 100755 (executable)
@@ -19,7 +19,7 @@ test_expect_success setup '
 
        for l in a b c d e f g h i j k l m n o
        do
-               echo $l$l$l$l$l$l$l$l$l
+               echo $l$l$l$l$l$l$l$l$l || return 1
        done >oops &&
 
        test_tick &&
index e8375d1c970e3313302a2580d742f1e88732070c..2d53ce754c5fb75ceeaa43dc1ba2f748fd58f43e 100755 (executable)
@@ -29,7 +29,7 @@ test_expect_success setup '
                git add file1 &&
                test_tick &&
                git commit -m "$val" &&
-               git tag $val
+               git tag $val || return 1
        done
 '
 
index 6902807ff8790c14e47477fb603e50d195cf79c4..b1f90ba3250fa39863f6fe58e85b27613e303df4 100755 (executable)
@@ -143,7 +143,7 @@ test_expect_success 'git add with filemode=0, symlinks=0, and unmerged entries'
        do
                echo $s > stage$s &&
                echo "100755 $(git hash-object -w stage$s) $s   file" &&
-               echo "120000 $(printf $s | git hash-object -w -t blob --stdin) $s       symlink"
+               echo "120000 $(printf $s | git hash-object -w -t blob --stdin) $s       symlink" || return 1
        done | git update-index --index-info &&
        git config core.filemode 0 &&
        git config core.symlinks 0 &&
index a8ad5462d96d3e1acda9172f4f77806d7a3e8093..0276edbe3d389b70cace45906626276cce3db44b 100755 (executable)
@@ -70,7 +70,7 @@ test_crlf_subject_body_and_contents() {
                        for ref in ${LIB_CRLF_BRANCHES}
                        do
                                cat .crlf-${file}-\"\${ref}\".txt >>expect &&
-                               printf \"\n\" >>expect
+                               printf \"\n\" >>expect || return 1
                        done &&
                        git $command_and_args --format=\"%${atom}\" >actual &&
                        test_cmp expect actual
@@ -90,7 +90,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '
        do
                printf "  " >>expect &&
                cat .crlf-subject-${branch}.txt >>expect &&
-               printf "\n" >>expect
+               printf "\n" >>expect || return 1
        done &&
        git branch -v >tmp &&
        # Remove first two columns, and the line for the currently checked out branch