summaryrefslogtreecommitdiff
path: root/t/t5310-pack-bitmaps.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-04-21 00:23:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-21 00:23:35 (GMT)
commit2eebac2c496dae01899900e98809ab15d87e1dd1 (patch)
tree57b9e98233a73d7456ae456110b7e4009a5bb20e /t/t5310-pack-bitmaps.sh
parentab99efc817d463ddcd507a6457d33cd7643ed6dd (diff)
parent8e118e8490ca362e3575c733dd2c1e9ee1543f03 (diff)
downloadgit-2eebac2c496dae01899900e98809ab15d87e1dd1.zip
git-2eebac2c496dae01899900e98809ab15d87e1dd1.tar.gz
git-2eebac2c496dae01899900e98809ab15d87e1dd1.tar.bz2
Merge branch 'jk/pack-objects-bitmap-progress-fix'
When "git pack-objects" makes a literal copy of a part of existing packfile using the reachability bitmaps, its update to the progress meter was broken. * jk/pack-objects-bitmap-progress-fix: pack-objects: update "nr_seen" progress based on pack-reused count
Diffstat (limited to 't/t5310-pack-bitmaps.sh')
-rwxr-xr-xt/t5310-pack-bitmaps.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index f53efc8..b028387 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -461,6 +461,29 @@ test_expect_success 'truncated bitmap fails gracefully (cache)' '
test_i18ngrep corrupted.bitmap.index stderr
'
+test_expect_success 'enumerating progress counts pack-reused objects' '
+ count=$(git rev-list --objects --all --count) &&
+ git repack -adb &&
+
+ # check first with only reused objects; confirm that our progress
+ # showed the right number, and also that we did pack-reuse as expected.
+ # Check only the final "done" line of the meter (there may be an
+ # arbitrary number of intermediate lines ending with CR).
+ GIT_PROGRESS_DELAY=0 \
+ git pack-objects --all --stdout --progress \
+ </dev/null >/dev/null 2>stderr &&
+ grep "Enumerating objects: $count, done" stderr &&
+ grep "pack-reused $count" stderr &&
+
+ # now the same but with one non-reused object
+ git commit --allow-empty -m "an extra commit object" &&
+ GIT_PROGRESS_DELAY=0 \
+ git pack-objects --all --stdout --progress \
+ </dev/null >/dev/null 2>stderr &&
+ grep "Enumerating objects: $((count+1)), done" stderr &&
+ grep "pack-reused $count" stderr
+'
+
# have_delta <obj> <expected_base>
#
# Note that because this relies on cat-file, it might find _any_ copy of an