[PATCH v2 7/7] stash: simplify reset_tree() function signature
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Oct 14, 2026, 15:40 UTC
- Message-ID
- <db53bf3b57e2bef504ad137fc1d896a2bc840e14.1791992404.git.phillip.wood@dunelm.org.uk>
- In-Reply-To
- <cover.1791992404.git.phillip.wood@dunelm.org.uk>
From: Phillip Wood <phillip.wood@dunelm.org.uk>
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 <phillip.wood@dunelm.org.uk> --- 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