]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/perf/p5303-many-packs.sh
Merge branch 'en/ort-perf-batch-9'
[thirdparty/git.git] / t / perf / p5303-many-packs.sh
index d90d7149231442485a0bc5dcc73071887f534799..35c0cbdf49fbc14d659f9abff7e8624a6ae14cec 100755 (executable)
@@ -31,8 +31,15 @@ repack_into_n () {
        ' "$1" >pushes &&
 
        # create base packfile
-       head -n 1 pushes |
-       git pack-objects --delta-base-offset --revs staging/pack &&
+       base_pack=$(
+               head -n 1 pushes |
+               git pack-objects --delta-base-offset --revs staging/pack
+       ) &&
+       test_export base_pack &&
+
+       # create an empty packfile
+       empty_pack=$(git pack-objects staging/pack </dev/null) &&
+       test_export empty_pack &&
 
        # and then incrementals between each pair of commits
        last= &&
@@ -49,6 +56,12 @@ repack_into_n () {
                last=$rev
        done <pushes &&
 
+       (
+               find staging -type f -name 'pack-*.pack' |
+                       xargs -n 1 basename | grep -v "$base_pack" &&
+               printf "^pack-%s.pack\n" $base_pack
+       ) >stdin.packs
+
        # and install the whole thing
        rm -f .git/objects/pack/* &&
        mv staging/* .git/objects/pack/
@@ -91,6 +104,23 @@ do
                  --reflog --indexed-objects --delta-base-offset \
                  --stdout </dev/null >/dev/null
        '
+
+       test_perf "repack with kept ($nr_packs)" '
+               git pack-objects --keep-true-parents \
+                 --keep-pack=pack-$empty_pack.pack \
+                 --honor-pack-keep --non-empty --all \
+                 --reflog --indexed-objects --delta-base-offset \
+                 --stdout </dev/null >/dev/null
+       '
+
+       test_perf "repack with --stdin-packs ($nr_packs)" '
+               git pack-objects \
+                 --keep-true-parents \
+                 --stdin-packs \
+                 --non-empty \
+                 --delta-base-offset \
+                 --stdout <stdin.packs >/dev/null
+       '
 done
 
 # Measure pack loading with 10,000 packs.