aboutsummaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-27 13:59:09 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-27 13:59:09 -0700
commit6e5fb398d3503ecea3c8ddeeb3c9c8a8c7b6a4ba (patch)
treec61316a2ba59166fc56de303b2459e6f32654371 /builtin/add.c
parent6b6c366e79a1e688526ece01cd1d6a2fa46d0071 (diff)
parentecf9ba20e35ded94d6b1f44f83bb9f7c32162654 (diff)
downloadgit-6e5fb398d3503ecea3c8ddeeb3c9c8a8c7b6a4ba.tar.xz
Merge branch 'ds/sparse-apply-add-p'
"git apply" and "git add -i/-p" code paths no longer unnecessarily expand sparse-index while working. * ds/sparse-apply-add-p: p2000: add performance test for patch-mode commands reset: integrate sparse index with --patch git add: make -p/-i aware of sparse index apply: integrate with the sparse index
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 747511b68b..7c292ffdc6 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -390,6 +390,10 @@ int cmd_add(int argc,
argc = parse_options(argc, argv, prefix, builtin_add_options,
builtin_add_usage, PARSE_OPT_KEEP_ARGV0);
+
+ prepare_repo_settings(repo);
+ repo->settings.command_requires_full_index = 0;
+
if (patch_interactive)
add_interactive = 1;
if (add_interactive) {
@@ -426,9 +430,6 @@ int cmd_add(int argc,
add_new_files = !take_worktree_changes && !refresh_only && !add_renormalize;
require_pathspec = !(take_worktree_changes || (0 < addremove_explicit));
- prepare_repo_settings(repo);
- repo->settings.command_requires_full_index = 0;
-
repo_hold_locked_index(repo, &lock_file, LOCK_DIE_ON_ERROR);
/*