Skip to content

Commit 1a4ee4d

Browse files
committed
fixup! checkout.c: enable fscache for checkout_entry
The recently introduced speedup of `git checkout` sadly introduced a regression: after writing a file, the cached stat data is obviously incorrect, yet we still used it! This patch simply reverts the original speedup (as opposed to try to hotfix it as #1443 tries to do), and marks it as a fixup commit so that the next merging-rebase will drop the patch. We will most likely want to speed up this code path, though, but may find a better way, e.g. by invalidating the cached data cleverly. (This will be a *little* tricky, though, as readdir() uses the data, and we must ensure that we do not pull it under readdir()'s rag when invalidating it, and we also must avoid re-caching for every written file, as that would be *even* slower than fscache=false.) This fixes #1438 and #1442 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e76e5c4 commit 1a4ee4d

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

builtin/checkout.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ static int checkout_paths(const struct checkout_opts *opts,
359359
state.istate = &the_index;
360360

361361
enable_delayed_checkout(&state);
362-
enable_fscache(1);
363362
for (pos = 0; pos < active_nr; pos++) {
364363
struct cache_entry *ce = active_cache[pos];
365364
if (ce->ce_flags & CE_MATCHED) {
@@ -374,7 +373,6 @@ static int checkout_paths(const struct checkout_opts *opts,
374373
pos = skip_same_name(ce, pos) - 1;
375374
}
376375
}
377-
enable_fscache(0);
378376
errs |= finish_delayed_checkout(&state);
379377

380378
if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))

0 commit comments

Comments
 (0)