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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2018-01-22 14:24:42 +01:00
parent ac9ec91052
commit e76e5c4b13

View File

@@ -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) {