diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-02-26 02:47:33 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-26 02:47:33 +0300 |
commit | 6249ce2d1b9b60e7aa630d370e68c87ef6331629 (patch) | |
tree | fafbfe509b3e197c0b1681d417d2cd1d220d8b84 /sparse-index.c | |
parent | 268e6b8d4d95d9ade705666e152a4c054da32a47 (diff) | |
parent | 3ce113827287079dced9aaf9c5d1e1734ecaa265 (diff) |
Merge branch 'ds/sparse-checkout-requires-per-worktree-config'
"git sparse-checkout" wants to work with per-worktree configuration,
but did not work well in a worktree attached to a bare repository.
* ds/sparse-checkout-requires-per-worktree-config:
config: make git_configset_get_string_tmp() private
worktree: copy sparse-checkout patterns and config on add
sparse-checkout: set worktree-config correctly
config: add repo_config_set_worktree_gently()
worktree: create init_worktree_config()
Documentation: add extensions.worktreeConfig details
Diffstat (limited to 'sparse-index.c')
-rw-r--r-- | sparse-index.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sparse-index.c b/sparse-index.c index 08f54747bb..fdbe97b976 100644 --- a/sparse-index.c +++ b/sparse-index.c @@ -99,13 +99,9 @@ static int convert_to_sparse_rec(struct index_state *istate, int set_sparse_index_config(struct repository *repo, int enable) { - int res; - char *config_path = repo_git_path(repo, "config.worktree"); - res = git_config_set_in_file_gently(config_path, - "index.sparse", - enable ? "true" : NULL); - free(config_path); - + int res = repo_config_set_worktree_gently(repo, + "index.sparse", + enable ? "true" : "false"); prepare_repo_settings(repo); repo->settings.sparse_index = enable; return res; |