Skip to content

Commit a83f7f5

Browse files
pks-tgitster
authored andcommitted
setup: unset ref storage when reinitializing repository version
When reinitializing a repository's version we may end up unsetting the hash algorithm when it matches the default hash algorithm. If we didn't do that then the previously configured value might remain intact. While the same issue exists for the ref storage extension, we don't do this here. This has been fine for most of the part because it is not supported to re-initialize a repository with a different ref storage format anyway. We're about to introduce a new command to migrate ref storages though, so this is about to become an issue there. Prepare for this and unset the ref storage format when reinitializing a repository with the "files" format. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0ff6d23 commit a83f7f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,6 +2028,8 @@ void initialize_repository_version(int hash_algo,
20282028
if (ref_storage_format != REF_STORAGE_FORMAT_FILES)
20292029
git_config_set("extensions.refstorage",
20302030
ref_storage_format_to_name(ref_storage_format));
2031+
else if (reinit)
2032+
git_config_set_gently("extensions.refstorage", NULL);
20312033
}
20322034

20332035
static int is_reinit(void)

0 commit comments

Comments
 (0)