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>

Nguyễn Thái Ngọc Duy committed Jan 12, 2019 at 09:13 UTC fb4a8464a6d7ba643a8ebdb3ad8e1e84f0a01b0a
1 file changed +1 -1
builtin/checkout.c
+1 -1
@@ -284,7 +284,7 @@ static int checkout_paths(const struct checkout_opts *opts,
284 return run_add_interactive(revision, "--patch=checkout",
285 &opts->pathspec);
286
287 - hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
287 + repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
288 if (read_cache_preload(&opts->pathspec) < 0)
289 return error(_("index file corrupt"));
290