Skip to content

Commit effc2ba

Browse files
dschogitster
authored andcommitted
tests (pack-objects): use the full, unabbreviated --revs option
To use the singular form of a word, when the option wants the plural form (and quietly expands it because it thinks it was abbreviated), is an easy mistake to make, and t5317 contains almost two dozen of them. However, using abbreviated options in tests is a bit fragile, so we will disallow use of abbreviated options in our test suite. In preparation for this change, let's fix `t5317-pack-objects-filter-objects.sh`. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c4932b0 commit effc2ba

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

t/t5317-pack-objects-filter-objects.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test_expect_success 'verify blob count in normal packfile' '
2525
awk -f print_2.awk ls_files_result |
2626
sort >expected &&
2727
28-
git -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&
28+
git -C r1 pack-objects --revs --stdout >all.pack <<-EOF &&
2929
HEAD
3030
EOF
3131
git -C r1 index-pack ../all.pack &&
@@ -39,7 +39,7 @@ test_expect_success 'verify blob count in normal packfile' '
3939
'
4040

4141
test_expect_success 'verify blob:none packfile has no blobs' '
42-
git -C r1 pack-objects --rev --stdout --filter=blob:none >filter.pack <<-EOF &&
42+
git -C r1 pack-objects --revs --stdout --filter=blob:none >filter.pack <<-EOF &&
4343
HEAD
4444
EOF
4545
git -C r1 index-pack ../filter.pack &&
@@ -74,7 +74,7 @@ test_expect_success 'get an error for missing tree object' '
7474
git -C r5 commit -m "foo" &&
7575
del=$(git -C r5 rev-parse HEAD^{tree} | sed "s|..|&/|") &&
7676
rm r5/.git/objects/$del &&
77-
test_must_fail git -C r5 pack-objects --rev --stdout 2>bad_tree <<-EOF &&
77+
test_must_fail git -C r5 pack-objects --revs --stdout 2>bad_tree <<-EOF &&
7878
HEAD
7979
EOF
8080
grep "bad tree object" bad_tree
@@ -88,7 +88,7 @@ test_expect_success 'setup for tests of tree:0' '
8888
'
8989

9090
test_expect_success 'verify tree:0 packfile has no blobs or trees' '
91-
git -C r1 pack-objects --rev --stdout --filter=tree:0 >commitsonly.pack <<-EOF &&
91+
git -C r1 pack-objects --revs --stdout --filter=tree:0 >commitsonly.pack <<-EOF &&
9292
HEAD
9393
EOF
9494
git -C r1 index-pack ../commitsonly.pack &&
@@ -98,7 +98,7 @@ test_expect_success 'verify tree:0 packfile has no blobs or trees' '
9898

9999
test_expect_success 'grab tree directly when using tree:0' '
100100
# We should get the tree specified directly but not its blobs or subtrees.
101-
git -C r1 pack-objects --rev --stdout --filter=tree:0 >commitsonly.pack <<-EOF &&
101+
git -C r1 pack-objects --revs --stdout --filter=tree:0 >commitsonly.pack <<-EOF &&
102102
HEAD:
103103
EOF
104104
git -C r1 index-pack ../commitsonly.pack &&
@@ -128,7 +128,7 @@ test_expect_success 'verify blob count in normal packfile' '
128128
awk -f print_2.awk ls_files_result |
129129
sort >expected &&
130130
131-
git -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&
131+
git -C r2 pack-objects --revs --stdout >all.pack <<-EOF &&
132132
HEAD
133133
EOF
134134
git -C r2 index-pack ../all.pack &&
@@ -142,7 +142,7 @@ test_expect_success 'verify blob count in normal packfile' '
142142
'
143143

144144
test_expect_success 'verify blob:limit=500 omits all blobs' '
145-
git -C r2 pack-objects --rev --stdout --filter=blob:limit=500 >filter.pack <<-EOF &&
145+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=500 >filter.pack <<-EOF &&
146146
HEAD
147147
EOF
148148
git -C r2 index-pack ../filter.pack &&
@@ -157,7 +157,7 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '
157157
'
158158

159159
test_expect_success 'verify blob:limit=1000' '
160-
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1000 >filter.pack <<-EOF &&
160+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1000 >filter.pack <<-EOF &&
161161
HEAD
162162
EOF
163163
git -C r2 index-pack ../filter.pack &&
@@ -176,7 +176,7 @@ test_expect_success 'verify blob:limit=1001' '
176176
awk -f print_2.awk ls_files_result |
177177
sort >expected &&
178178
179-
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&
179+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&
180180
HEAD
181181
EOF
182182
git -C r2 index-pack ../filter.pack &&
@@ -194,7 +194,7 @@ test_expect_success 'verify blob:limit=10001' '
194194
awk -f print_2.awk ls_files_result |
195195
sort >expected &&
196196
197-
git -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&
197+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&
198198
HEAD
199199
EOF
200200
git -C r2 index-pack ../filter.pack &&
@@ -212,7 +212,7 @@ test_expect_success 'verify blob:limit=1k' '
212212
awk -f print_2.awk ls_files_result |
213213
sort >expected &&
214214
215-
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
215+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
216216
HEAD
217217
EOF
218218
git -C r2 index-pack ../filter.pack &&
@@ -230,7 +230,7 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '
230230
awk -f print_2.awk ls_files_result |
231231
sort >expected &&
232232
233-
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
233+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
234234
HEAD
235235
$(git -C r2 rev-parse HEAD:large.10000)
236236
EOF
@@ -249,7 +249,7 @@ test_expect_success 'verify blob:limit=1m' '
249249
awk -f print_2.awk ls_files_result |
250250
sort >expected &&
251251
252-
git -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&
252+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&
253253
HEAD
254254
EOF
255255
git -C r2 index-pack ../filter.pack &&
@@ -302,7 +302,7 @@ test_expect_success 'verify blob count in normal packfile' '
302302
awk -f print_2.awk ls_files_result |
303303
sort >expected &&
304304
305-
git -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&
305+
git -C r3 pack-objects --revs --stdout >all.pack <<-EOF &&
306306
HEAD
307307
EOF
308308
git -C r3 index-pack ../all.pack &&
@@ -320,7 +320,7 @@ test_expect_success 'verify sparse:path=pattern1' '
320320
awk -f print_2.awk ls_files_result |
321321
sort >expected &&
322322
323-
git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&
323+
git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&
324324
HEAD
325325
EOF
326326
git -C r3 index-pack ../filter.pack &&
@@ -352,7 +352,7 @@ test_expect_success 'verify sparse:path=pattern2' '
352352
awk -f print_2.awk ls_files_result |
353353
sort >expected &&
354354
355-
git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&
355+
git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&
356356
HEAD
357357
EOF
358358
git -C r3 index-pack ../filter.pack &&
@@ -404,7 +404,7 @@ test_expect_success 'verify blob count in normal packfile' '
404404
awk -f print_2.awk ls_files_result |
405405
sort >expected &&
406406
407-
git -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&
407+
git -C r4 pack-objects --revs --stdout >all.pack <<-EOF &&
408408
HEAD
409409
EOF
410410
git -C r4 index-pack ../all.pack &&
@@ -423,7 +423,7 @@ test_expect_success 'verify sparse:oid=OID' '
423423
sort >expected &&
424424
425425
oid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&
426-
git -C r4 pack-objects --rev --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF &&
426+
git -C r4 pack-objects --revs --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF &&
427427
HEAD
428428
EOF
429429
git -C r4 index-pack ../filter.pack &&
@@ -441,7 +441,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '
441441
awk -f print_2.awk ls_files_result |
442442
sort >expected &&
443443
444-
git -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&
444+
git -C r4 pack-objects --revs --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&
445445
HEAD
446446
EOF
447447
git -C r4 index-pack ../filter.pack &&
@@ -470,19 +470,19 @@ test_expect_success 'setup r1 - delete loose blobs' '
470470
'
471471

472472
test_expect_success 'verify pack-objects fails w/ missing objects' '
473-
test_must_fail git -C r1 pack-objects --rev --stdout >miss.pack <<-EOF
473+
test_must_fail git -C r1 pack-objects --revs --stdout >miss.pack <<-EOF
474474
HEAD
475475
EOF
476476
'
477477

478478
test_expect_success 'verify pack-objects fails w/ --missing=error' '
479-
test_must_fail git -C r1 pack-objects --rev --stdout --missing=error >miss.pack <<-EOF
479+
test_must_fail git -C r1 pack-objects --revs --stdout --missing=error >miss.pack <<-EOF
480480
HEAD
481481
EOF
482482
'
483483

484484
test_expect_success 'verify pack-objects w/ --missing=allow-any' '
485-
git -C r1 pack-objects --rev --stdout --missing=allow-any >miss.pack <<-EOF
485+
git -C r1 pack-objects --revs --stdout --missing=allow-any >miss.pack <<-EOF
486486
HEAD
487487
EOF
488488
'

0 commit comments

Comments
 (0)