Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-06-05 12:10:01 +0300
committerJunio C Hamano <gitster@pobox.com>2020-06-05 20:13:30 +0300
commit16af5f1abb2b3291f96a248698449c48c6a0ec36 (patch)
treed8bae1f1b88f0b6b6717b19de757075c90b2b1b4 /list-objects-filter-options.c
parent2d5e9f31ac46017895ce6a183467037d29ceb9d3 (diff)
repository: add a helper function to perform repository format upgrade
In version 1 of repository format, "extensions" gained special meaning and it is safer to avoid upgrading when there are pre-existing extensions. Make list-objects-filter to use the helper function instead of setting repository version directly as a prerequisite of exposing the upgrade capability. Signed-off-by: Xin Li <delphij@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects-filter-options.c')
-rw-r--r--list-objects-filter-options.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
index 256bcfbdfe..3553ad7b0a 100644
--- a/list-objects-filter-options.c
+++ b/list-objects-filter-options.c
@@ -326,7 +326,8 @@ void partial_clone_register(
/* Check if it is already registered */
if (!promisor_remote_find(remote)) {
- git_config_set("core.repositoryformatversion", "1");
+ if (upgrade_repository_format(1) < 0)
+ die(_("unable to upgrade repository format to support partial clone"));
/* Add promisor config for the remote */
cfg_name = xstrfmt("remote.%s.promisor", remote);