mirror of
https://github.com/git/git
synced 2024-08-27 03:29:21 +00:00
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>
This commit is contained in:
parent
dcbaa0b361
commit
61de0ff695
|
@ -20,8 +20,9 @@ test_expect_success 'setup r1' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob count in normal packfile' '
|
test_expect_success 'verify blob count in normal packfile' '
|
||||||
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |
|
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \
|
||||||
awk -f print_2.awk |
|
>ls_files_result &&
|
||||||
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&
|
git -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&
|
||||||
|
@ -29,8 +30,8 @@ test_expect_success 'verify blob count in normal packfile' '
|
||||||
EOF
|
EOF
|
||||||
git -C r1 index-pack ../all.pack &&
|
git -C r1 index-pack ../all.pack &&
|
||||||
|
|
||||||
git -C r1 verify-pack -v ../all.pack |
|
git -C r1 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -43,8 +44,8 @@ test_expect_success 'verify blob:none packfile has no blobs' '
|
||||||
EOF
|
EOF
|
||||||
git -C r1 index-pack ../filter.pack &&
|
git -C r1 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r1 verify-pack -v ../filter.pack |
|
git -C r1 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -53,13 +54,13 @@ test_expect_success 'verify blob:none packfile has no blobs' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '
|
test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '
|
||||||
git -C r1 verify-pack -v ../all.pack |
|
git -C r1 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r1 verify-pack -v ../filter.pack |
|
git -C r1 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -82,8 +83,8 @@ test_expect_success 'setup r2' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob count in normal packfile' '
|
test_expect_success 'verify blob count in normal packfile' '
|
||||||
git -C r2 ls-files -s large.1000 large.10000 |
|
git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&
|
git -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&
|
||||||
|
@ -91,8 +92,8 @@ test_expect_success 'verify blob count in normal packfile' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../all.pack &&
|
git -C r2 index-pack ../all.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../all.pack |
|
git -C r2 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -105,8 +106,8 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../filter.pack &&
|
git -C r2 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -120,8 +121,8 @@ test_expect_success 'verify blob:limit=1000' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../filter.pack &&
|
git -C r2 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -130,8 +131,8 @@ test_expect_success 'verify blob:limit=1000' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=1001' '
|
test_expect_success 'verify blob:limit=1001' '
|
||||||
git -C r2 ls-files -s large.1000 |
|
git -C r2 ls-files -s large.1000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&
|
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&
|
||||||
|
@ -139,8 +140,8 @@ test_expect_success 'verify blob:limit=1001' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../filter.pack &&
|
git -C r2 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -148,8 +149,8 @@ test_expect_success 'verify blob:limit=1001' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=10001' '
|
test_expect_success 'verify blob:limit=10001' '
|
||||||
git -C r2 ls-files -s large.1000 large.10000 |
|
git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&
|
git -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&
|
||||||
|
@ -157,8 +158,8 @@ test_expect_success 'verify blob:limit=10001' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../filter.pack &&
|
git -C r2 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -166,8 +167,8 @@ test_expect_success 'verify blob:limit=10001' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=1k' '
|
test_expect_success 'verify blob:limit=1k' '
|
||||||
git -C r2 ls-files -s large.1000 |
|
git -C r2 ls-files -s large.1000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
|
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
|
||||||
|
@ -175,8 +176,8 @@ test_expect_success 'verify blob:limit=1k' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../filter.pack &&
|
git -C r2 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -184,8 +185,8 @@ test_expect_success 'verify blob:limit=1k' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify explicitly specifying oversized blob in input' '
|
test_expect_success 'verify explicitly specifying oversized blob in input' '
|
||||||
git -C r2 ls-files -s large.1000 large.10000 |
|
git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
|
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
|
||||||
|
@ -194,8 +195,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../filter.pack &&
|
git -C r2 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -203,8 +204,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=1m' '
|
test_expect_success 'verify blob:limit=1m' '
|
||||||
git -C r2 ls-files -s large.1000 large.10000 |
|
git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&
|
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&
|
||||||
|
@ -212,8 +213,8 @@ test_expect_success 'verify blob:limit=1m' '
|
||||||
EOF
|
EOF
|
||||||
git -C r2 index-pack ../filter.pack &&
|
git -C r2 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -221,13 +222,13 @@ test_expect_success 'verify blob:limit=1m' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '
|
test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '
|
||||||
git -C r2 verify-pack -v ../all.pack |
|
git -C r2 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 verify-pack -v ../filter.pack |
|
git -C r2 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -255,8 +256,9 @@ test_expect_success 'setup r3' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob count in normal packfile' '
|
test_expect_success 'verify blob count in normal packfile' '
|
||||||
git -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |
|
git -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \
|
||||||
awk -f print_2.awk |
|
>ls_files_result &&
|
||||||
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&
|
git -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&
|
||||||
|
@ -264,8 +266,8 @@ test_expect_success 'verify blob count in normal packfile' '
|
||||||
EOF
|
EOF
|
||||||
git -C r3 index-pack ../all.pack &&
|
git -C r3 index-pack ../all.pack &&
|
||||||
|
|
||||||
git -C r3 verify-pack -v ../all.pack |
|
git -C r3 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -273,8 +275,8 @@ test_expect_success 'verify blob count in normal packfile' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:path=pattern1' '
|
test_expect_success 'verify sparse:path=pattern1' '
|
||||||
git -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |
|
git -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&
|
git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&
|
||||||
|
@ -282,8 +284,8 @@ test_expect_success 'verify sparse:path=pattern1' '
|
||||||
EOF
|
EOF
|
||||||
git -C r3 index-pack ../filter.pack &&
|
git -C r3 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r3 verify-pack -v ../filter.pack |
|
git -C r3 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -291,13 +293,13 @@ test_expect_success 'verify sparse:path=pattern1' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '
|
test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '
|
||||||
git -C r3 verify-pack -v ../all.pack |
|
git -C r3 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 verify-pack -v ../filter.pack |
|
git -C r3 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -305,8 +307,8 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:path=pattern2' '
|
test_expect_success 'verify sparse:path=pattern2' '
|
||||||
git -C r3 ls-files -s sparse1 dir1/sparse1 |
|
git -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&
|
git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&
|
||||||
|
@ -314,8 +316,8 @@ test_expect_success 'verify sparse:path=pattern2' '
|
||||||
EOF
|
EOF
|
||||||
git -C r3 index-pack ../filter.pack &&
|
git -C r3 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r3 verify-pack -v ../filter.pack |
|
git -C r3 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -323,13 +325,13 @@ test_expect_success 'verify sparse:path=pattern2' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '
|
test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '
|
||||||
git -C r3 verify-pack -v ../all.pack |
|
git -C r3 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 verify-pack -v ../filter.pack |
|
git -C r3 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep -E "commit|tree" |
|
grep -E "commit|tree" verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -356,8 +358,9 @@ test_expect_success 'setup r4' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob count in normal packfile' '
|
test_expect_success 'verify blob count in normal packfile' '
|
||||||
git -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |
|
git -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \
|
||||||
awk -f print_2.awk |
|
>ls_files_result &&
|
||||||
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&
|
git -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&
|
||||||
|
@ -365,8 +368,8 @@ test_expect_success 'verify blob count in normal packfile' '
|
||||||
EOF
|
EOF
|
||||||
git -C r4 index-pack ../all.pack &&
|
git -C r4 index-pack ../all.pack &&
|
||||||
|
|
||||||
git -C r4 verify-pack -v ../all.pack |
|
git -C r4 verify-pack -v ../all.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -374,8 +377,8 @@ test_expect_success 'verify blob count in normal packfile' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:oid=OID' '
|
test_expect_success 'verify sparse:oid=OID' '
|
||||||
git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |
|
git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
oid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&
|
oid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&
|
||||||
|
@ -384,8 +387,8 @@ test_expect_success 'verify sparse:oid=OID' '
|
||||||
EOF
|
EOF
|
||||||
git -C r4 index-pack ../filter.pack &&
|
git -C r4 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r4 verify-pack -v ../filter.pack |
|
git -C r4 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -393,8 +396,8 @@ test_expect_success 'verify sparse:oid=OID' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:oid=oid-ish' '
|
test_expect_success 'verify sparse:oid=oid-ish' '
|
||||||
git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |
|
git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&
|
git -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&
|
||||||
|
@ -402,8 +405,8 @@ test_expect_success 'verify sparse:oid=oid-ish' '
|
||||||
EOF
|
EOF
|
||||||
git -C r4 index-pack ../filter.pack &&
|
git -C r4 index-pack ../filter.pack &&
|
||||||
|
|
||||||
git -C r4 verify-pack -v ../filter.pack |
|
git -C r4 verify-pack -v ../filter.pack >verify_result &&
|
||||||
grep blob |
|
grep blob verify_result |
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -414,8 +417,9 @@ test_expect_success 'verify sparse:oid=oid-ish' '
|
||||||
# This models previously omitted objects that we did not receive.
|
# This models previously omitted objects that we did not receive.
|
||||||
|
|
||||||
test_expect_success 'setup r1 - delete loose blobs' '
|
test_expect_success 'setup r1 - delete loose blobs' '
|
||||||
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |
|
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \
|
||||||
awk -f print_2.awk |
|
>ls_files_result &&
|
||||||
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
for id in `cat expected | sed "s|..|&/|"`
|
for id in `cat expected | sed "s|..|&/|"`
|
||||||
|
|
|
@ -35,8 +35,8 @@ test_expect_success 'setup bare clone for server' '
|
||||||
test_expect_success 'do partial clone 1' '
|
test_expect_success 'do partial clone 1' '
|
||||||
git clone --no-checkout --filter=blob:none "file://$(pwd)/srv.bare" pc1 &&
|
git clone --no-checkout --filter=blob:none "file://$(pwd)/srv.bare" pc1 &&
|
||||||
|
|
||||||
git -C pc1 rev-list HEAD --quiet --objects --missing=print |
|
git -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/?//" |
|
sed "s/?//" |
|
||||||
sort >observed.oids &&
|
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' '
|
test_expect_success 'manual prefetch of missing objects' '
|
||||||
git -C pc1 fetch --filter=blob:none origin &&
|
git -C pc1 fetch --filter=blob:none origin &&
|
||||||
|
|
||||||
git -C pc1 rev-list master..origin/master --quiet --objects --missing=print |
|
git -C pc1 rev-list master..origin/master --quiet --objects --missing=print \
|
||||||
awk -f print_1.awk |
|
>revs &&
|
||||||
|
awk -f print_1.awk revs |
|
||||||
sed "s/?//" |
|
sed "s/?//" |
|
||||||
sort >observed.oids &&
|
sort >observed.oids &&
|
||||||
|
|
||||||
test_line_count = 6 observed.oids &&
|
test_line_count = 6 observed.oids &&
|
||||||
git -C pc1 fetch-pack --stdin "file://$(pwd)/srv.bare" <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 |
|
git -C pc1 rev-list master..origin/master --quiet --objects --missing=print \
|
||||||
awk -f print_1.awk |
|
>revs &&
|
||||||
|
awk -f print_1.awk revs |
|
||||||
sed "s/?//" |
|
sed "s/?//" |
|
||||||
sort >observed.oids &&
|
sort >observed.oids &&
|
||||||
|
|
||||||
|
|
|
@ -20,12 +20,13 @@ test_expect_success 'setup r1' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:none omits all 5 blobs' '
|
test_expect_success 'verify blob:none omits all 5 blobs' '
|
||||||
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |
|
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \
|
||||||
awk -f print_2.awk |
|
>ls_files_result &&
|
||||||
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |
|
git -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -33,12 +34,13 @@ test_expect_success 'verify blob:none omits all 5 blobs' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify emitted+omitted == all' '
|
test_expect_success 'verify emitted+omitted == all' '
|
||||||
git -C r1 rev-list HEAD --objects |
|
git -C r1 rev-list HEAD --objects >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |
|
git -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \
|
||||||
awk -f print_1.awk |
|
>revs &&
|
||||||
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -62,12 +64,12 @@ test_expect_success 'setup r2' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=500 omits all blobs' '
|
test_expect_success 'verify blob:limit=500 omits all blobs' '
|
||||||
git -C r2 ls-files -s large.1000 large.10000 |
|
git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |
|
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -75,12 +77,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify emitted+omitted == all' '
|
test_expect_success 'verify emitted+omitted == all' '
|
||||||
git -C r2 rev-list HEAD --objects |
|
git -C r2 rev-list HEAD --objects >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |
|
git -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -88,12 +90,12 @@ test_expect_success 'verify emitted+omitted == all' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=1000' '
|
test_expect_success 'verify blob:limit=1000' '
|
||||||
git -C r2 ls-files -s large.1000 large.10000 |
|
git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |
|
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -101,12 +103,12 @@ test_expect_success 'verify blob:limit=1000' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=1001' '
|
test_expect_success 'verify blob:limit=1001' '
|
||||||
git -C r2 ls-files -s large.10000 |
|
git -C r2 ls-files -s large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |
|
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -114,12 +116,12 @@ test_expect_success 'verify blob:limit=1001' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=1k' '
|
test_expect_success 'verify blob:limit=1k' '
|
||||||
git -C r2 ls-files -s large.10000 |
|
git -C r2 ls-files -s large.10000 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |
|
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -127,8 +129,8 @@ test_expect_success 'verify blob:limit=1k' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify blob:limit=1m' '
|
test_expect_success 'verify blob:limit=1m' '
|
||||||
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |
|
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -156,12 +158,12 @@ test_expect_success 'setup r3' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:path=pattern1 omits top-level files' '
|
test_expect_success 'verify sparse:path=pattern1 omits top-level files' '
|
||||||
git -C r3 ls-files -s sparse1 sparse2 |
|
git -C r3 ls-files -s sparse1 sparse2 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |
|
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -169,12 +171,12 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '
|
test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '
|
||||||
git -C r3 ls-files -s sparse2 dir1/sparse2 |
|
git -C r3 ls-files -s sparse2 dir1/sparse2 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |
|
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -192,14 +194,14 @@ test_expect_success 'setup r3 part 2' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:oid=OID omits top-level files' '
|
test_expect_success 'verify sparse:oid=OID omits top-level files' '
|
||||||
git -C r3 ls-files -s pattern sparse1 sparse2 |
|
git -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
oid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&
|
oid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&
|
||||||
|
|
||||||
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |
|
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -207,12 +209,12 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
|
test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
|
||||||
git -C r3 ls-files -s pattern sparse1 sparse2 |
|
git -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&
|
||||||
awk -f print_2.awk |
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |
|
git -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/~//" |
|
sed "s/~//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
@ -223,8 +225,9 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
|
||||||
# This models previously omitted objects that we did not receive.
|
# This models previously omitted objects that we did not receive.
|
||||||
|
|
||||||
test_expect_success 'rev-list W/ --missing=print' '
|
test_expect_success 'rev-list W/ --missing=print' '
|
||||||
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |
|
git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \
|
||||||
awk -f print_2.awk |
|
>ls_files_result &&
|
||||||
|
awk -f print_2.awk ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
|
||||||
for id in `cat expected | sed "s|..|&/|"`
|
for id in `cat expected | sed "s|..|&/|"`
|
||||||
|
@ -232,8 +235,8 @@ test_expect_success 'rev-list W/ --missing=print' '
|
||||||
rm r1/.git/objects/$id
|
rm r1/.git/objects/$id
|
||||||
done &&
|
done &&
|
||||||
|
|
||||||
git -C r1 rev-list --quiet HEAD --missing=print --objects |
|
git -C r1 rev-list --quiet HEAD --missing=print --objects >revs &&
|
||||||
awk -f print_1.awk |
|
awk -f print_1.awk revs |
|
||||||
sed "s/?//" |
|
sed "s/?//" |
|
||||||
sort >observed &&
|
sort >observed &&
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue