aboutsummaryrefslogtreecommitdiff
path: root/add-patch.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-02 13:13:08 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-03 15:09:35 -0800
commit0c5583a57d618db191afceeff54e8cafbee89f41 (patch)
tree2f9efd7a1283ec541f91df7f37527325b5c8e499 /add-patch.h
parentd51b61f5dab9c8e715fa792f31d572bc96fb5687 (diff)
downloadgit-0c5583a57d618db191afceeff54e8cafbee89f41.tar.xz
add-patch: add support for in-memory index patching
With `run_add_p()` callers have the ability to apply changes from a specific revision to a repository's index. This infra supports several different modes, like for example applying changes to the index, working tree or both. One feature that is missing though is the ability to apply changes to an in-memory index different from the repository's index. Add a new function `run_add_p_index()` to plug this gap. This new function will be used in a subsequent commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'add-patch.h')
-rw-r--r--add-patch.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/add-patch.h b/add-patch.h
index e6868c60a2..cf2a31a40f 100644
--- a/add-patch.h
+++ b/add-patch.h
@@ -3,6 +3,7 @@
#include "color.h"
+struct index_state;
struct pathspec;
struct repository;
@@ -56,4 +57,11 @@ int run_add_p(struct repository *r, enum add_p_mode mode,
struct interactive_options *opts, const char *revision,
const struct pathspec *ps);
+int run_add_p_index(struct repository *r,
+ struct index_state *index,
+ const char *index_file,
+ struct interactive_options *opts,
+ const char *revision,
+ const struct pathspec *ps);
+
#endif