From: Nguyễn Thái Ngọc Duy Date: Sat, 12 Jan 2019 02:13:25 +0000 (+0700) Subject: checkout: avoid the_index when possible X-Git-Tag: v2.21.0-rc0~23^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb4a8464a6d7ba643a8ebdb3ad8e1e84f0a01b0a;p=thirdparty%2Fgit.git checkout: avoid the_index when possible Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/builtin/checkout.c b/builtin/checkout.c index 08b0ac48f3..1b672a9fd9 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -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"));