summaryrefslogtreecommitdiff
path: root/t/t1600-index.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-10-23 20:38:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-24 02:33:45 (GMT)
commitc11e9966cb7a2e6b1069df43796815d119cf2d7f (patch)
tree0cc0ffedcb21fe37dc45bda852d8137f02953fbe /t/t1600-index.sh
parentaaf633c2ad10b47af7623c130ddfe7231658c7e4 (diff)
downloadgit-c11e9966cb7a2e6b1069df43796815d119cf2d7f.zip
git-c11e9966cb7a2e6b1069df43796815d119cf2d7f.tar.gz
git-c11e9966cb7a2e6b1069df43796815d119cf2d7f.tar.bz2
repo-settings: read an int for index.version
Several config options were combined into a repo_settings struct in ds/feature-macros, including a move of the "index.version" config setting in 7211b9e (repo-settings: consolidate some config settings, 2019-08-13). Unfortunately, that file looked like a lot of boilerplate and what is clearly a factor of copy-paste overload, the config setting is parsed with repo_config_ge_bool() instead of repo_config_get_int(). This means that a setting "index.version=4" would not register correctly and would revert to the default version of 3. I caught this while incorporating v2.24.0-rc0 into the VFS for Git codebase, where we really care that the index is in version 4. This was not caught by the codebase because the version checks placed in t1600-index.sh did not test the "basic" scenario enough. Here, we modify the test to include these normal settings to not be overridden by features.manyFiles or GIT_INDEX_VERSION. While the "default" version is 3, this is demoted to version 2 in do_write_index() when not necessary. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1600-index.sh')
-rwxr-xr-xt/t1600-index.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t1600-index.sh b/t/t1600-index.sh
index c77721b..b7c31aa 100755
--- a/t/t1600-index.sh
+++ b/t/t1600-index.sh
@@ -87,6 +87,10 @@ test_index_version () {
}
test_expect_success 'index version config precedence' '
+ test_index_version 0 false 0 2 &&
+ test_index_version 2 false 0 2 &&
+ test_index_version 3 false 0 2 &&
+ test_index_version 4 false 0 4 &&
test_index_version 2 false 4 4 &&
test_index_version 2 true 0 2 &&
test_index_version 0 true 0 4 &&