summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-05-25 19:04:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-05-25 19:04:08 -0700
commit5e04a1ee33f82051668f09d73cf16348169e7f1f (patch)
tree2484cb203a6b0c68773371fc629b29536d1966c8 /builtin-checkout.c
parentMerge branch 'jm/format-patch-no-auto-n-when-k-is-given' into maint (diff)
parentTeach 'git checkout' to preload the index contents (diff)
downloadtgif-5e04a1ee33f82051668f09d73cf16348169e7f1f.tar.xz
Merge branch 'lt/maint-diff-reduce-lstat' into maint
* lt/maint-diff-reduce-lstat: Teach 'git checkout' to preload the index contents Avoid unnecessary 'lstat()' calls in 'get_stat_data()'
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index f2d7ef01b0..b8a4b0139b 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -216,7 +216,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
newfd = hold_locked_index(lock_file, 1);
- if (read_cache() < 0)
+ if (read_cache_preload(pathspec) < 0)
return error("corrupt index file");
if (source_tree)
@@ -366,7 +366,7 @@ static int merge_working_tree(struct checkout_opts *opts,
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
int newfd = hold_locked_index(lock_file, 1);
- if (read_cache() < 0)
+ if (read_cache_preload(NULL) < 0)
return error("corrupt index file");
if (opts->force) {