Skip to content

Commit

Permalink
fixup! reset.c: enable fscache
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dscho committed Jan 22, 2018
1 parent ac9ec91 commit e76e5c4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions builtin/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e76e5c4

Please sign in to comment.