aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-11-08 10:33:19 -0800
committerJunio C Hamano <gitster@pobox.com>2025-11-08 10:33:19 -0800
commit374eaa29420f6c01755fc579e08032fdb9962a7c (patch)
tree1c82d8fdfb7bf79615c95be2277388addcbb2bb7 /builtin/checkout.c
parentMerge branch 'ms/doc-worktree-side-by-side' into seen (diff)
parentbuiltin/history: implement "split" subcommand (diff)
downloadgit-374eaa29420f6c01755fc579e08032fdb9962a7c.tar.gz
git-374eaa29420f6c01755fc579e08032fdb9962a7c.zip
Merge branch 'ps/history' into seen
"git history" history rewriting UI. Comments? * ps/history: builtin/history: implement "split" subcommand cache-tree: allow writing in-memory index as tree add-patch: add support for in-memory index patching add-patch: remove dependency on "add-interactive" subsystem add-patch: split out `struct interactive_options` add-patch: split out header from "add-interactive.h" builtin/history: implement "reword" subcommand builtin: add new "history" command replay: stop using `the_repository` replay: extract logic to pick commits wt-status: provide function to expose status for trees
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 66b69df6e6..c09065cc61 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -546,7 +546,7 @@ static int checkout_paths(const struct checkout_opts *opts,
if (opts->patch_mode) {
enum add_p_mode patch_mode;
- struct add_p_opt add_p_opt = {
+ struct interactive_options interactive_opts = {
.context = opts->patch_context,
.interhunkcontext = opts->patch_interhunk_context,
};
@@ -575,7 +575,7 @@ static int checkout_paths(const struct checkout_opts *opts,
else
BUG("either flag must have been set, worktree=%d, index=%d",
opts->checkout_worktree, opts->checkout_index);
- return !!run_add_p(the_repository, patch_mode, &add_p_opt,
+ return !!run_add_p(the_repository, patch_mode, &interactive_opts,
rev, &opts->pathspec);
}
@@ -902,7 +902,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,