From e76e5c4b139b7aae896f75fa569508f951876a9b Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 22 Jan 2018 14:24:42 +0100 Subject: [PATCH] fixup! reset.c: enable fscache The recent speedup to `git reset` sadly broke things, as the cached stat data is no longer accurate after writing the file(s). And that is exactly what `git reset` does: writing the file(s). This patch is identical to the one provided in https://github.com/git-for-windows/git/pull/1445 but added a bit more detailed information, as well as marking it as a fixup so that the next merging-rebase will drop the patch altogether. This fixes https://github.com/git-for-windows/git/issues/1437 and https://github.com/git-for-windows/git/issues/1440. Signed-off-by: Johannes Schindelin --- builtin/reset.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/builtin/reset.c b/builtin/reset.c index 82ef326246..627c76a23c 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -52,7 +52,6 @@ static int reset_index(const struct object_id *oid, int reset_type, int quiet) struct tree *tree; struct unpack_trees_options opts; int ret = -1; - int unpack_result; memset(&opts, 0, sizeof(opts)); opts.head_idx = 1; @@ -92,11 +91,7 @@ static int reset_index(const struct object_id *oid, int reset_type, int quiet) } nr++; - enable_fscache(1); - unpack_result = unpack_trees(nr, desc, &opts); - enable_fscache(0); - - if (unpack_result) + if (unpack_trees(nr, desc, &opts)) goto out; if (reset_type == MIXED || reset_type == HARD) {