aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-02 13:13:10 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-03 15:09:36 -0800
commita021e4f92cbacdb028b3efa49f619b076e72c9a6 (patch)
tree552c7bb354106e9635e43f3098febc0224d34305 /builtin
parent48f6d9232834be661f0d1dc4f187b324124ccbe0 (diff)
downloadgit-a021e4f92cbacdb028b3efa49f619b076e72c9a6.tar.xz
cache-tree: allow writing in-memory index as tree
The function `write_in_core_index_as_tree()` takes a repository and writes its index into a tree object. What this function cannot do though is to take an _arbitrary_ in-memory index. Introduce a new `struct index_state` parameter so that the caller can pass a different index than the one belonging to the repository. This 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 'builtin')
-rw-r--r--builtin/checkout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index a8863277f2..f8b3a7b08c 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -891,7 +891,8 @@ static int merge_working_tree(const struct checkout_opts *opts,
0);
init_ui_merge_options(&o, the_repository);
o.verbosity = 0;
- work = write_in_core_index_as_tree(the_repository);
+ work = write_in_core_index_as_tree(the_repository,
+ the_repository->index);
ret = reset_tree(new_tree,
opts, 1,