From: Phillip Wood Date: Tue, 20 Oct 2026 15:20:42 GMT Subject: [PATCH v3 7/7] stash: simplify reset_tree() function signature Message-ID: In-Reply-To: From: Phillip Wood There is only one caller and it does not want to update the worktree or reset the index so remove those unused parameters. Signed-off-by: Phillip Wood --- builtin/stash.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index 55916259c3..bc1252790b 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -332,7 +332,7 @@ static int clear_stash(int argc, const char **argv, const char *prefix, return do_clear_stash(); } -static int reset_tree(struct object_id *i_tree, int update, int reset) +static int reset_tree(struct object_id *i_tree) { int nr_trees = 1; struct unpack_trees_options opts; @@ -358,10 +358,6 @@ static int reset_tree(struct object_id *i_tree, int update, int reset) opts.src_index = the_repository->index; opts.dst_index = the_repository->index; opts.merge = 1; - opts.reset = reset ? UNPACK_RESET_PROTECT_UNTRACKED : 0; - opts.update = update; - if (update) - opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */ opts.fn = oneway_merge; if (unpack_trees(nr_trees, t, &opts)) @@ -738,7 +734,7 @@ static enum stash_apply_result do_apply_stash(const char *prefix, } if (has_index) { - if (reset_tree(&index_tree, 0, 0)) + if (reset_tree(&index_tree)) ret = -1; } else { unstage_changes_unless_new(&c_tree); -- 2.56.0.134.g299a3c16181