diff options
author | Matthew DeVore <matvore@google.com> | 2018-10-05 14:54:05 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-07 08:51:18 +0900 |
commit | 61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f (patch) | |
tree | 78f14ce297ced493f0057e9a3730b47ee1345f58 /t/t5616-partial-clone.sh | |
parent | t/*: fix ordering of expected/observed arguments (diff) | |
download | tgif-61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f.tar.xz |
tests: don't swallow Git errors upstream of pipes
Some pipes in tests lose the exit code of git processes, which can mask
unexpected behavior like crashes. Split these pipes up so that git
commands are only at the end of pipes rather than the beginning or
middle.
The violations fixed in this patch were found in the process of fixing
pipe placement in a prior patch.
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5616-partial-clone.sh')
-rwxr-xr-x | t/t5616-partial-clone.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index e4d032c9db..fc7aeb1abd 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -35,8 +35,8 @@ test_expect_success 'setup bare clone for server' ' test_expect_success 'do partial clone 1' ' git clone --no-checkout --filter=blob:none "file://$(pwd)/srv.bare" pc1 && - git -C pc1 rev-list HEAD --quiet --objects --missing=print | - awk -f print_1.awk | + git -C pc1 rev-list HEAD --quiet --objects --missing=print >revs && + awk -f print_1.awk revs | sed "s/?//" | sort >observed.oids && @@ -133,16 +133,18 @@ test_expect_success 'push new commits to server for file.3.txt' ' test_expect_success 'manual prefetch of missing objects' ' git -C pc1 fetch --filter=blob:none origin && - git -C pc1 rev-list master..origin/master --quiet --objects --missing=print | - awk -f print_1.awk | + git -C pc1 rev-list master..origin/master --quiet --objects --missing=print \ + >revs && + awk -f print_1.awk revs | sed "s/?//" | sort >observed.oids && test_line_count = 6 observed.oids && git -C pc1 fetch-pack --stdin "file://$(pwd)/srv.bare" <observed.oids && - git -C pc1 rev-list master..origin/master --quiet --objects --missing=print | - awk -f print_1.awk | + git -C pc1 rev-list master..origin/master --quiet --objects --missing=print \ + >revs && + awk -f print_1.awk revs | sed "s/?//" | sort >observed.oids && |