diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-08-04 23:28:53 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-04 23:28:53 +0300 |
commit | 506d2a354a9b24c531634094292b11ed8b8c2514 (patch) | |
tree | 2324d28eddd75395949471683f6eeec9781d841d /builtin | |
parent | 58705b490314cb9a6f70916b4b69062b66ca7130 (diff) | |
parent | e05cdb17e89a2d3257533d47350b3138bfce8737 (diff) |
Merge branch 'ds/commit-and-checkout-with-sparse-index'
"git checkout" and "git commit" learn to work without unnecessarily
expanding sparse indexes.
* ds/commit-and-checkout-with-sparse-index:
unpack-trees: resolve sparse-directory/file conflicts
t1092: document bad 'git checkout' behavior
checkout: stop expanding sparse indexes
sparse-index: recompute cache-tree
commit: integrate with sparse-index
p2000: compress repo names
p2000: add 'git checkout -' test and decrease depth
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/checkout.c | 8 | ||||
-rw-r--r-- | builtin/commit.c | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index f4cd7747d3..b5d477919a 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -378,9 +378,6 @@ static int checkout_worktree(const struct checkout_opts *opts, if (pc_workers > 1) init_parallel_checkout(); - /* TODO: audit for interaction with sparse-index. */ - ensure_full_index(&the_index); - for (pos = 0; pos < active_nr; pos++) { struct cache_entry *ce = active_cache[pos]; if (ce->ce_flags & CE_MATCHED) { @@ -530,8 +527,6 @@ static int checkout_paths(const struct checkout_opts *opts, * Make sure all pathspecs participated in locating the paths * to be checked out. */ - /* TODO: audit for interaction with sparse-index. */ - ensure_full_index(&the_index); for (pos = 0; pos < active_nr; pos++) if (opts->overlay_mode) mark_ce_for_checkout_overlay(active_cache[pos], @@ -1593,6 +1588,9 @@ static int checkout_main(int argc, const char **argv, const char *prefix, git_config(git_checkout_config, opts); + prepare_repo_settings(the_repository); + the_repository->settings.command_requires_full_index = 0; + opts->track = BRANCH_TRACK_UNSPECIFIED; if (!opts->accept_pathspec && !opts->accept_ref) diff --git a/builtin/commit.c b/builtin/commit.c index 7436262aae..243c626307 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1689,6 +1689,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix) if (argc == 2 && !strcmp(argv[1], "-h")) usage_with_options(builtin_commit_usage, builtin_commit_options); + prepare_repo_settings(the_repository); + the_repository->settings.command_requires_full_index = 0; + status_init_config(&s, git_commit_config); s.commit_template = 1; status_format = STATUS_FORMAT_NONE; /* Ignore status.short */ |