mirror of
https://github.com/git/git.git
synced 2024-11-27 03:53:55 +08:00
t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'
Two years ago, commitff1e653c8e
(midx: respect 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP', 2021-08-31) introduced a new environment variable which caused the test suite to write MIDX bitmaps after any 'git repack' invocation. At the time, this was done to help flush out any bugs with MIDX bitmaps that weren't explicitly covered in the t5326-multi-pack-bitmap.sh script. Two years later, that flag has served us well and is no longer providing meaningful coverage, as the script in t5326 has matured substantially and covers many more interesting cases than it did back whenff1e653c8e
was originally written. Remove the 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP' environment variable as it is no longer serving a useful purpose. More importantly, removing this variable clears the way for us to introduce a new one to help similarly flush out bugs related to incremental MIDX chains. Because these incremental MIDX chains are (for now) incompatible with MIDX bitmaps, we cannot have both. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3592796d0a
commit
9552c3595a
@ -1217,10 +1217,6 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||
if (!write_midx &&
|
||||
(!(pack_everything & ALL_INTO_ONE) || !is_bare_repository()))
|
||||
write_bitmaps = 0;
|
||||
} else if (write_bitmaps &&
|
||||
git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0) &&
|
||||
git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0)) {
|
||||
write_bitmaps = 0;
|
||||
}
|
||||
if (pack_kept_objects < 0)
|
||||
pack_kept_objects = write_bitmaps > 0 && !write_midx;
|
||||
@ -1518,12 +1514,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||
if (run_update_server_info)
|
||||
update_server_info(0);
|
||||
|
||||
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) {
|
||||
unsigned flags = 0;
|
||||
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0))
|
||||
flags |= MIDX_WRITE_BITMAP | MIDX_WRITE_REV_INDEX;
|
||||
write_midx_file(get_object_directory(), NULL, NULL, flags);
|
||||
}
|
||||
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0))
|
||||
write_midx_file(get_object_directory(), NULL, NULL, 0);
|
||||
|
||||
cleanup:
|
||||
string_list_clear(&names, 1);
|
||||
|
@ -25,7 +25,6 @@ linux-TEST-vars)
|
||||
export GIT_TEST_COMMIT_GRAPH=1
|
||||
export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
|
||||
export GIT_TEST_MULTI_PACK_INDEX=1
|
||||
export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
|
||||
export GIT_TEST_NO_WRITE_REV_INDEX=1
|
||||
export GIT_TEST_CHECKOUT_WORKERS=2
|
||||
|
2
midx.h
2
midx.h
@ -29,8 +29,6 @@ struct bitmapped_pack;
|
||||
#define MIDX_LARGE_OFFSET_NEEDED 0x80000000
|
||||
|
||||
#define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX"
|
||||
#define GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP \
|
||||
"GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP"
|
||||
|
||||
struct multi_pack_index {
|
||||
struct multi_pack_index *next;
|
||||
|
4
t/README
4
t/README
@ -469,10 +469,6 @@ GIT_TEST_MULTI_PACK_INDEX=<boolean>, when true, forces the multi-pack-
|
||||
index to be written after every 'git repack' command, and overrides the
|
||||
'core.multiPackIndex' setting to true.
|
||||
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=<boolean>, when true, sets the
|
||||
'--bitmap' option on all invocations of 'git multi-pack-index write',
|
||||
and ignores pack-objects' '--write-bitmap-index'.
|
||||
|
||||
GIT_TEST_SIDEBAND_ALL=<boolean>, when true, overrides the
|
||||
'uploadpack.allowSidebandAll' setting to true, and when false, forces
|
||||
fetch-pack to not request sideband-all (even if the server advertises
|
||||
|
@ -5,8 +5,6 @@ test_description='partial clone'
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-terminal.sh
|
||||
|
||||
# missing promisor objects cause repacks which write bitmaps to fail
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
|
||||
# When enabled, some commands will write commit-graphs. This causes fsck
|
||||
# to fail when delete_object() is called because fsck will attempt to
|
||||
# verify the out-of-sync commit graph.
|
||||
|
@ -5,10 +5,6 @@ test_description='exercise basic bitmap functionality'
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-bitmap.sh
|
||||
|
||||
# t5310 deals only with single-pack bitmaps, so don't write MIDX bitmaps in
|
||||
# their place.
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
|
||||
|
||||
# Likewise, allow individual tests to control whether or not they use
|
||||
# the boundary-based traversal.
|
||||
sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
|
||||
|
@ -600,8 +600,7 @@ test_expect_success 'repack preserves multi-pack-index when creating packs' '
|
||||
compare_results_with_midx "after repack"
|
||||
|
||||
test_expect_success 'multi-pack-index and pack-bitmap' '
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
|
||||
git -c repack.writeBitmaps=true repack -ad &&
|
||||
git -c repack.writeBitmaps=true repack -ad &&
|
||||
git multi-pack-index write &&
|
||||
git rev-list --test-bitmap HEAD
|
||||
'
|
||||
|
@ -4,10 +4,9 @@ test_description='exercise basic multi-pack bitmap functionality'
|
||||
. ./test-lib.sh
|
||||
. "${TEST_DIRECTORY}/lib-bitmap.sh"
|
||||
|
||||
# We'll be writing our own midx and bitmaps, so avoid getting confused by the
|
||||
# We'll be writing our own MIDX, so avoid getting confused by the
|
||||
# automatic ones.
|
||||
GIT_TEST_MULTI_PACK_INDEX=0
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
|
||||
|
||||
# This test exercise multi-pack bitmap functionality where the object order is
|
||||
# stored and read from a special chunk within the MIDX, so use the default
|
||||
|
@ -5,10 +5,9 @@ test_description='exercise basic multi-pack bitmap functionality (.rev files)'
|
||||
. ./test-lib.sh
|
||||
. "${TEST_DIRECTORY}/lib-bitmap.sh"
|
||||
|
||||
# We'll be writing our own midx and bitmaps, so avoid getting confused by the
|
||||
# automatic ones.
|
||||
# We'll be writing our own MIDX, so avoid getting confused by the automatic
|
||||
# ones.
|
||||
GIT_TEST_MULTI_PACK_INDEX=0
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
|
||||
|
||||
# Unlike t5326, this test exercise multi-pack bitmap functionality where the
|
||||
# object order is stored in a separate .rev file.
|
||||
|
@ -70,14 +70,13 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
|
||||
|
||||
test_expect_success 'writing bitmaps via command-line can duplicate .keep objects' '
|
||||
# build on $oid, $packid, and .keep state from previous
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 git repack -Adbl &&
|
||||
git repack -Adbl &&
|
||||
test_has_duplicate_object true
|
||||
'
|
||||
|
||||
test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
|
||||
# build on $oid, $packid, and .keep state from previous
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
|
||||
git -c repack.writebitmaps=true repack -Adl &&
|
||||
git -c repack.writebitmaps=true repack -Adl &&
|
||||
test_has_duplicate_object true
|
||||
'
|
||||
|
||||
@ -284,8 +283,7 @@ test_expect_success 'repacking fails when missing .pack actually means missing o
|
||||
test_expect_success 'bitmaps are created by default in bare repos' '
|
||||
git clone --bare .git bare.git &&
|
||||
rm -f bare.git/objects/pack/*.bitmap &&
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
|
||||
git -C bare.git repack -ad &&
|
||||
git -C bare.git repack -ad &&
|
||||
bitmap=$(ls bare.git/objects/pack/*.bitmap) &&
|
||||
test_path_is_file "$bitmap"
|
||||
'
|
||||
@ -296,8 +294,7 @@ test_expect_success 'incremental repack does not complain' '
|
||||
'
|
||||
|
||||
test_expect_success 'bitmaps can be disabled on bare repos' '
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
|
||||
git -c repack.writeBitmaps=false -C bare.git repack -ad &&
|
||||
git -c repack.writeBitmaps=false -C bare.git repack -ad &&
|
||||
bitmap=$(ls bare.git/objects/pack/*.bitmap || :) &&
|
||||
test -z "$bitmap"
|
||||
'
|
||||
@ -308,8 +305,7 @@ test_expect_success 'no bitmaps created if .keep files present' '
|
||||
keep=${pack%.pack}.keep &&
|
||||
test_when_finished "rm -f \"\$keep\"" &&
|
||||
>"$keep" &&
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
|
||||
git -C bare.git repack -ad 2>stderr &&
|
||||
git -C bare.git repack -ad 2>stderr &&
|
||||
test_must_be_empty stderr &&
|
||||
find bare.git/objects/pack/ -type f -name "*.bitmap" >actual &&
|
||||
test_must_be_empty actual
|
||||
@ -320,8 +316,7 @@ test_expect_success 'auto-bitmaps do not complain if unavailable' '
|
||||
blob=$(test-tool genrandom big $((1024*1024)) |
|
||||
git -C bare.git hash-object -w --stdin) &&
|
||||
git -C bare.git update-ref refs/tags/big $blob &&
|
||||
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
|
||||
git -C bare.git repack -ad 2>stderr &&
|
||||
git -C bare.git repack -ad 2>stderr &&
|
||||
test_must_be_empty stderr &&
|
||||
find bare.git/objects/pack -type f -name "*.bitmap" >actual &&
|
||||
test_must_be_empty actual
|
||||
@ -342,9 +337,7 @@ test_expect_success 'repacking with a filter works' '
|
||||
'
|
||||
|
||||
test_expect_success '--filter fails with --write-bitmap-index' '
|
||||
test_must_fail \
|
||||
env GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
|
||||
git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
|
||||
test_must_fail git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
|
||||
'
|
||||
|
||||
test_expect_success 'repacking with two filters works' '
|
||||
|
Loading…
Reference in New Issue
Block a user