diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-04-28 02:00:59 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-28 02:00:59 +0300 |
commit | 849c8b3dbf8e850020951e81a42df4dc0b1e5b5d (patch) | |
tree | 5b0187c4a8a834b0afb5674e5f623af7f8b2ca2c /t | |
parent | 2807bd2c10606e590886543afe4e4f208dddd489 (diff) | |
parent | 9f7f10a282d8adeb9da0990aa0eb2adf93a47ca7 (diff) |
Merge branch 'tb/pack-revindex-on-disk'
The on-disk reverse index that allows mapping from the pack offset
to the object name for the object stored at the offset has been
enabled by default.
* tb/pack-revindex-on-disk:
t: invert `GIT_TEST_WRITE_REV_INDEX`
config: enable `pack.writeReverseIndex` by default
pack-revindex: introduce `pack.readReverseIndex`
pack-revindex: introduce GIT_TEST_REV_INDEX_DIE_ON_DISK
pack-revindex: make `load_pack_revindex` take a repository
t5325: mark as leak-free
pack-write.c: plug a leak in stage_tmp_packfiles()
Diffstat (limited to 't')
-rw-r--r-- | t/README | 2 | ||||
-rwxr-xr-x | t/perf/p5312-pack-bitmaps-revs.sh | 3 | ||||
-rwxr-xr-x | t/t5325-reverse-index.sh | 16 |
3 files changed, 17 insertions, 4 deletions
@@ -475,7 +475,7 @@ GIT_TEST_DEFAULT_HASH=<hash-algo> specifies which hash algorithm to use in the test scripts. Recognized values for <hash-algo> are "sha1" and "sha256". -GIT_TEST_WRITE_REV_INDEX=<boolean>, when true enables the +GIT_TEST_NO_WRITE_REV_INDEX=<boolean>, when true disables the 'pack.writeReverseIndex' setting. GIT_TEST_SPARSE_INDEX=<boolean>, when true enables index writes to use the diff --git a/t/perf/p5312-pack-bitmaps-revs.sh b/t/perf/p5312-pack-bitmaps-revs.sh index 0684b690af..ceec60656b 100755 --- a/t/perf/p5312-pack-bitmaps-revs.sh +++ b/t/perf/p5312-pack-bitmaps-revs.sh @@ -12,8 +12,7 @@ test_lookup_pack_bitmap () { test_perf_large_repo test_expect_success 'setup bitmap config' ' - git config pack.writebitmaps true && - git config pack.writeReverseIndex true + git config pack.writebitmaps true ' # we need to create the tag up front such that it is covered by the repack and diff --git a/t/t5325-reverse-index.sh b/t/t5325-reverse-index.sh index d042d26f2b..0548fce1aa 100755 --- a/t/t5325-reverse-index.sh +++ b/t/t5325-reverse-index.sh @@ -1,17 +1,20 @@ #!/bin/sh test_description='on-disk reverse index' + +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh # The below tests want control over the 'pack.writeReverseIndex' setting # themselves to assert various combinations of it with other options. -sane_unset GIT_TEST_WRITE_REV_INDEX +sane_unset GIT_TEST_NO_WRITE_REV_INDEX packdir=.git/objects/pack test_expect_success 'setup' ' test_commit base && + test_config pack.writeReverseIndex false && pack=$(git pack-objects --all $packdir/pack) && rev=$packdir/pack-$pack.rev && @@ -94,6 +97,17 @@ test_expect_success 'reverse index is not generated when available on disk' ' --batch-check="%(objectsize:disk)" <tip ' +test_expect_success 'reverse index is ignored when pack.readReverseIndex is false' ' + test_index_pack true && + test_path_is_file $rev && + + test_config pack.readReverseIndex false && + + git rev-parse HEAD >tip && + GIT_TEST_REV_INDEX_DIE_ON_DISK=1 git cat-file \ + --batch-check="%(objectsize:disk)" <tip +' + test_expect_success 'revindex in-memory vs on-disk' ' git init repo && test_when_finished "rm -fr repo" && |