mirror of
https://github.com/git/git.git
synced 2025-01-27 09:53:42 +08:00
checkout: avoid the_index when possible
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3a95f31d1c
commit
fb4a8464a6
@ -284,7 +284,7 @@ static int checkout_paths(const struct checkout_opts *opts,
|
||||
return run_add_interactive(revision, "--patch=checkout",
|
||||
&opts->pathspec);
|
||||
|
||||
hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
|
||||
repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
|
||||
if (read_cache_preload(&opts->pathspec) < 0)
|
||||
return error(_("index file corrupt"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user