@@ -22,71 +22,55 @@ test_expect_success 'create rev input' '
2222 EOF
2323'
2424
25- for version in 1 2
26- do
27- export version
25+ test_all_with_args () {
26+ parameter= $1
27+ export parameter
2828
29- test_perf " thin pack with version $version " '
29+ test_perf " thin pack with $parameter " '
3030 git pack-objects --thin --stdout --revs --sparse \
31- --name-hash-version=$version <in-thin >out
31+ $parameter <in-thin >out
3232 '
3333
34- test_size " thin pack size with version $version " '
34+ test_size " thin pack size with $parameter " '
3535 test_file_size out
3636 '
3737
38- test_perf " big pack with version $version " '
38+ test_perf " big pack with $parameter " '
3939 git pack-objects --stdout --revs --sparse \
40- --name-hash-version=$version <in-big >out
40+ $parameter <in-big >out
4141 '
4242
43- test_size " big pack size with version $version " '
43+ test_size " big pack size with $parameter " '
4444 test_file_size out
4545 '
4646
47- test_perf " shallow fetch pack with version $version " '
47+ test_perf " shallow fetch pack with $parameter " '
4848 git pack-objects --stdout --revs --sparse --shallow \
49- --name-hash-version=$version <in-shallow >out
49+ $parameter <in-shallow >out
5050 '
5151
52- test_size " shallow pack size with version $version " '
52+ test_size " shallow pack size with $parameter " '
5353 test_file_size out
5454 '
55+ }
56+
57+ for version in 1 2
58+ do
59+ export version
60+
61+ test_all_with_args --name-hash-version=$version
5562
56- test_perf " repack with version $version " '
63+ test_perf " repack with --name-hash- version= $version " '
5764 git repack -adf --name-hash-version=$version
5865 '
5966
60- test_size " repack size with version $version " '
67+ test_size " repack size with --name-hash- version= $version " '
6168 gitdir=$(git rev-parse --git-dir) &&
6269 pack=$(ls $gitdir/objects/pack/pack-*.pack) &&
6370 test_file_size "$pack"
6471 '
6572done
6673
67- test_perf ' thin pack with --path-walk' '
68- git pack-objects --thin --stdout --revs --sparse --path-walk <in-thin >out
69- '
70-
71- test_size ' thin pack size with --path-walk' '
72- test_file_size out
73- '
74-
75- test_perf ' big pack with --path-walk' '
76- git pack-objects --stdout --revs --sparse --path-walk <in-big >out
77- '
78-
79- test_size ' big pack size with --path-walk' '
80- test_file_size out
81- '
82-
83- test_perf ' repack with --path-walk' '
84- git repack -adf --path-walk
85- '
86-
87- test_size ' repack size with --path-walk' '
88- pack=$(ls .git/objects/pack/pack-*.pack) &&
89- test_file_size "$pack"
90- '
74+ test_all_with_args --path-walk
9175
9276test_done
0 commit comments