Skip to content

Commit 406631e

Browse files
committed
stash: avoid unnecessary reset_tree() call
In 45c1389 (stash: convert apply to builtin, 2018-12-20), we introduced code that is the equivalent of `git write-tree && git read-tree`. But the original shell script only called `git write-tree` (because the read-tree would obviously be a no-op). So let's skip the reset_tree() call that is the equivalent that that `git read-tree`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 20316da commit 406631e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/stash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
404404
if (refresh_cache(REFRESH_QUIET))
405405
return -1;
406406

407-
if (write_cache_as_tree(&c_tree, 0, NULL) || reset_tree(&c_tree, 0, 0))
407+
if (write_cache_as_tree(&c_tree, 0, NULL))
408408
return error(_("cannot apply a stash in the middle of a merge"));
409409

410410
if (index) {

0 commit comments

Comments
 (0)