summaryrefslogtreecommitdiff
path: root/t/t5616-partial-clone.sh
diff options
context:
space:
mode:
authorMatthew DeVore <matvore@google.com>2018-10-05 21:54:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-06 23:51:18 (GMT)
commit61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f (patch)
tree78f14ce297ced493f0057e9a3730b47ee1345f58 /t/t5616-partial-clone.sh
parentdcbaa0b361f5bebcbe6eca446819fadd02083461 (diff)
downloadgit-61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f.zip
git-61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f.tar.gz
git-61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f.tar.bz2
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-xt/t5616-partial-clone.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index e4d032c..fc7aeb1 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 &&