diff options
author | Xin Li <delphij@google.com> | 2020-06-05 11:10:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-05 19:13:30 +0200 |
commit | 98564d805938cae8b72687a9e39d65b00ac7ad27 (patch) | |
tree | 78a12f098bdac401631df84dbf1c681b5d1991d7 /builtin/sparse-checkout.c | |
parent | fetch: allow adding a filter after initial clone (diff) | |
download | git-98564d805938cae8b72687a9e39d65b00ac7ad27.tar.xz git-98564d805938cae8b72687a9e39d65b00ac7ad27.zip |
sparse-checkout: upgrade repository to version 1 when enabling extension
The 'extensions' configuration variable gets special meaning in the new
repository version, so when enabling the extension we should upgrade the
repository to version 1.
Signed-off-by: Xin Li <delphij@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/sparse-checkout.c')
-rw-r--r-- | builtin/sparse-checkout.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index 95d0882417..95669815d4 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -249,6 +249,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; |