aboutsummaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-07 15:59:42 -0800
committerJunio C Hamano <gitster@pobox.com>2024-03-07 15:59:42 -0800
commitce65a188b15bef0ef68e81d5b083e7dda34ab2c9 (patch)
tree00ade2576f1a531ec0ae1ce18269770d87b109bc /setup.c
parent6a887bdd9276acbcf359d86cc121fc4161293d13 (diff)
parent199f44cb2ead34486f2588dc32d000d17e30f9cc (diff)
downloadgit-ce65a188b15bef0ef68e81d5b083e7dda34ab2c9.tar.gz
Merge branch 'ps/remote-helper-repo-initialization-fix'
A custom remote helper no longer cannot access the newly created repository during "git clone", which is a regression in Git 2.44. This has been corrected. * ps/remote-helper-repo-initialization-fix: builtin/clone: allow remote helpers to detect repo
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index b69b1cbc2a..e3b76e84b5 100644
--- a/setup.c
+++ b/setup.c
@@ -1889,6 +1889,13 @@ void initialize_repository_version(int hash_algo,
char repo_version_string[10];
int repo_version = GIT_REPO_VERSION;
+ /*
+ * Note that we initialize the repository version to 1 when the ref
+ * storage format is unknown. This is on purpose so that we can add the
+ * correct object format to the config during git-clone(1). The format
+ * version will get adjusted by git-clone(1) once it has learned about
+ * the remote repository's format.
+ */
if (hash_algo != GIT_HASH_SHA1 ||
ref_storage_format != REF_STORAGE_FORMAT_FILES)
repo_version = GIT_REPO_VERSION_READ;
@@ -1898,7 +1905,7 @@ void initialize_repository_version(int hash_algo,
"%d", repo_version);
git_config_set("core.repositoryformatversion", repo_version_string);
- if (hash_algo != GIT_HASH_SHA1)
+ if (hash_algo != GIT_HASH_SHA1 && hash_algo != GIT_HASH_UNKNOWN)
git_config_set("extensions.objectformat",
hash_algos[hash_algo].name);
else if (reinit)