aboutsummaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 1d1667fa4c..e031e61886 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -532,7 +532,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,
.auto_advance = opts->auto_advance
@@ -562,8 +562,8 @@ 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,
- rev, &opts->pathspec);
+ return !!run_add_p(the_repository, patch_mode, &interactive_opts,
+ rev, &opts->pathspec, 0);
}
repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
@@ -891,7 +891,8 @@ static int merge_working_tree(const struct checkout_opts *opts,
0, 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,