Teach 'git checkout' to preload the index contents
[gitweb.git] / builtin-checkout.c
index b5dd9c07b42e0130384259715730f52bc8c4e6c3..f1342abd025a3dc5f533205f623c1a82ffbf2ebe 100644 (file)
@@ -228,7 +228,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)
@@ -373,7 +373,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) {