]> git.ipfire.org Git - thirdparty/git.git/commit - t/t6120-describe.sh
t6000-t9999: detect and signal failure within loop
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 9 Dec 2021 05:11:15 +0000 (00:11 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Dec 2021 18:29:48 +0000 (10:29 -0800)
commit0c51d6b4aec9f1959d148960cb55155b676cec78
tree3b7e70327191ff2a03ec8aacb7f951fb72cb978c
parentd0fd993137cf41be66b54628f124b6651eea0bd2
t6000-t9999: detect and signal failure within loop

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>
32 files changed:
contrib/mw-to-git/t/t9365-continuing-queries.sh
t/annotate-tests.sh
t/t6005-rev-list-count.sh
t/t6009-rev-list-parent.sh
t/t6101-rev-parse-parents.sh
t/t6112-rev-list-filters-objects.sh
t/t6120-describe.sh
t/t6132-pathspec-exclude.sh
t/t6200-fmt-merge-msg.sh
t/t6300-for-each-ref.sh
t/t6412-merge-large-rename.sh
t/t6430-merge-recursive.sh
t/t6600-test-reach.sh
t/t7004-tag.sh
t/t7505-prepare-commit-msg-hook.sh
t/t7600-merge.sh
t/t7602-merge-octopus-many.sh
t/t7603-merge-reduce-heads.sh
t/t7700-repack.sh
t/t8014-blame-ignore-fuzzy.sh
t/t9104-git-svn-follow-parent.sh
t/t9130-git-svn-authors-file.sh
t/t9134-git-svn-ignore-paths.sh
t/t9138-git-svn-authors-prog.sh
t/t9146-git-svn-empty-dirs.sh
t/t9147-git-svn-include-paths.sh
t/t9152-svn-empty-dirs-after-gc.sh
t/t9304-fast-import-marks.sh
t/t9400-git-cvsserver-server.sh
t/t9800-git-p4-basic.sh
t/t9818-git-p4-block.sh
t/t9902-completion.sh