summaryrefslogtreecommitdiff
path: root/builtin/sparse-checkout.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-06-29 14:17:24 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-06-29 14:17:24 -0700
commit1033b982914206285fb7ee772cd29f7c60c4f929 (patch)
treedfae7465da8c987e8085ff6daccee6312505cc15 /builtin/sparse-checkout.c
parentThe fifth batch (diff)
parentcheck_repository_format_gently(): refuse extensions for old repositories (diff)
downloadtgif-1033b982914206285fb7ee772cd29f7c60c4f929.tar.xz
Merge branch 'xl/upgrade-repo-format'
Allow runtime upgrade of the repository format version, which needs to be done carefully. There is a rather unpleasant backward compatibility worry with the last step of this series, but it is the right thing to do in the longer term. * xl/upgrade-repo-format: check_repository_format_gently(): refuse extensions for old repositories sparse-checkout: upgrade repository to version 1 when enabling extension fetch: allow adding a filter after initial clone repository: add a helper function to perform repository format upgrade
Diffstat (limited to 'builtin/sparse-checkout.c')
-rw-r--r--builtin/sparse-checkout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 595463be68..4003f4d13a 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -253,6 +253,8 @@ static int set_config(enum sparse_checkout_mode mode)
{
const char *config_path;
+ if (upgrade_repository_format(1) < 0)
+ die(_("unable to upgrade repository format to enable worktreeConfig"));
if (git_config_set_gently("extensions.worktreeConfig", "true")) {
error(_("failed to set extensions.worktreeConfig setting"));
return 1;