aboutsummaryrefslogtreecommitdiffstats
path: root/t/lib-patch-mode.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2023-02-06 23:44:28 +0100
committerJunio C Hamano <gitster@pobox.com>2023-02-06 15:30:41 -0800
commitfb18dd2831323d5dece711cdbcaa9dcd8bf4edab (patch)
tree2e0f7a1587ddb4a92ad3ab8faf01b8b6cb4d7a52 /t/lib-patch-mode.sh
parentGit 2.39 (diff)
downloadgit-fb18dd2831323d5dece711cdbcaa9dcd8bf4edab.tar.gz
git-fb18dd2831323d5dece711cdbcaa9dcd8bf4edab.zip
auto-crlf tests: don't lose exit code in loops and outside tests
Change the functions which are called from within "test_expect_success" to add the "|| return 1" idiom to their for-loops, so we won't lose the exit code of "cp", "git" etc. Then for those setup functions that aren't called from a "test_expect_success" we need to put the setup code in a "test_expect_success" as well. It would not be enough to properly &&-chain these, as the calling code is the top-level script itself. As we don't run the tests with "set -e" we won't report failing commands at the top-level. The "checkout" part of this would miss memory leaks under SANITIZE=leak, this code doesn't leak (the relevant "git checkout" leak has been fixed), but in a past version of git we'd continue past this failure under SANITIZE=leak when these invocations had errored out, even under "--immediate". For checkout_files() we could run one test_expect_success() instead of the 5 we run now in a loop. But as this function added in [1] is already taking pains to split up its setup into phases (there are 5 more "test_expect_success()" at the end of it already, see [1]), let's follow that existing convention. 1. 343151dcbdf (t0027: combinations of core.autocrlf, core.eol and text, 2014-06-29) Helped-by: René Scharfe <l.s.r@web.de> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-patch-mode.sh')
0 files changed, 0 insertions, 0 deletions