pack-objects: add GIT_TEST_NAME_HASH_VERSION
Add a new environment variable to opt-in to different values of the --name-hash-version=<n> option in 'git pack-objects'. This allows for extra testing of the feature without repeating all of the test scenarios. Unlike many GIT_TEST_* variables, we are choosing to not add this to the linux-TEST-vars CI build as that test run is already overloaded. The behavior exposed by this test variable is of low risk and should be sufficient to allow manual testing when an issue arises. But this option isn't free. There are a few tests that change behavior with the variable enabled. First, there are a few tests that are very sensitive to certain delta bases being picked. These are both involving the generation of thin bundles and then counting their objects via 'git index-pack --fix-thin' which pulls the delta base into the new packfile. For these tests, disable the option as a decent long-term option. Second, there are some tests that compare the exact output of a 'git pack-objects' process when using bitmaps. The warning that ignores the --name-hash-version=2 and forces version 1 causes these tests to fail. Disable the environment variable to get around this issue. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
928ef41dd8
commit
ce961135cc
@@ -266,7 +266,7 @@ struct configured_exclusion {
|
||||
static struct oidmap configured_exclusions;
|
||||
|
||||
static struct oidset excluded_by_config;
|
||||
static int name_hash_version = 1;
|
||||
static int name_hash_version = -1;
|
||||
|
||||
/**
|
||||
* Check whether the name_hash_version chosen by user input is appropriate,
|
||||
@@ -4616,6 +4616,9 @@ int cmd_pack_objects(int argc,
|
||||
if (pack_to_stdout || !rev_list_all)
|
||||
write_bitmap_index = 0;
|
||||
|
||||
if (name_hash_version < 0)
|
||||
name_hash_version = (int)git_env_ulong("GIT_TEST_NAME_HASH_VERSION", 1);
|
||||
|
||||
validate_name_hash_version();
|
||||
|
||||
if (use_delta_islands)
|
||||
|
||||
Reference in New Issue
Block a user