From 65de8ee891be79e35ba13697b50ccb76bb742106 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 20 Feb 2019 22:22:18 +0100 Subject: [PATCH] stash: avoid unnecessary reset_tree() call In 45c1389c31b4 (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 --- builtin/stash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/stash.c b/builtin/stash.c index 14dd9f442a..794fba6e2d 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -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) {