Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-22 23:59:25 +0300
committerJunio C Hamano <gitster@pobox.com>2022-08-25 00:24:17 +0300
commit9905e80b0fd9af3e6536d6201bf0198ffa48e8c9 (patch)
treeb59e02fb2ffd83514ea8372a0bc5635db971d3b6 /t/t5329-pack-objects-cruft.sh
parent0e66bc1b215b1dd2b0f05c5777eb8ee2ae4e9523 (diff)
t5329: notice a failure within a loop
We try to write "|| return 1" (or "|| exit 1" in a subshell) at the end of a sequence of &&-chained command in a loop of our tests, so that a failure of any step during the earlier iteration of the loop can properly be caught. There is one loop in this test script that is used to compute the expected result, that will be later compared with an actual output produced by the "test-tool pack-mtimes" command. This particular loop, however, is placed on the upstream side of a pipe, whose non-zero exit code does not get noticed. Emit a line that will never be produced by the "test-tool pack-mtimes" to cause the later comparison to fail. As we use test_cmp to compare this "expected output" file with the "actual output", the "error message" we are emitting into the expected output stream will stand out and shown to the tester. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5329-pack-objects-cruft.sh')
-rwxr-xr-xt/t5329-pack-objects-cruft.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t5329-pack-objects-cruft.sh b/t/t5329-pack-objects-cruft.sh
index 6049e2c1d7..303f7a5d84 100755
--- a/t/t5329-pack-objects-cruft.sh
+++ b/t/t5329-pack-objects-cruft.sh
@@ -29,7 +29,8 @@ basic_cruft_pack_tests () {
while read oid
do
path="$objdir/$(test_oid_to_path "$oid")" &&
- printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" || exit 1
+ printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
+ echo "object list generation failed for $oid"
done |
sort -k1
) >expect &&