Skip to content

Commit e76e5c4

Browse files
committed
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 #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 #1437 and #1440. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent ac9ec91 commit e76e5c4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

builtin/reset.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static int reset_index(const struct object_id *oid, int reset_type, int quiet)
5252
struct tree *tree;
5353
struct unpack_trees_options opts;
5454
int ret = -1;
55-
int unpack_result;
5655

5756
memset(&opts, 0, sizeof(opts));
5857
opts.head_idx = 1;
@@ -92,11 +91,7 @@ static int reset_index(const struct object_id *oid, int reset_type, int quiet)
9291
}
9392
nr++;
9493

95-
enable_fscache(1);
96-
unpack_result = unpack_trees(nr, desc, &opts);
97-
enable_fscache(0);
98-
99-
if (unpack_result)
94+
if (unpack_trees(nr, desc, &opts))
10095
goto out;
10196

10297
if (reset_type == MIXED || reset_type == HARD) {

0 commit comments

Comments
 (0)