Skip to content

Commit

Permalink
stash: avoid unnecessary reset_tree() call
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Feb 20, 2019
1 parent 20316da commit 406631e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
if (refresh_cache(REFRESH_QUIET))
return -1;

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

if (index) {
Expand Down

0 comments on commit 406631e

Please sign in to comment.