summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-01-12 02:13:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-14 20:13:04 (GMT)
commitfb4a8464a6d7ba643a8ebdb3ad8e1e84f0a01b0a (patch)
tree9a65d0ec65d5bf43f9b30ee405c5074a4671f57c
parent3a95f31d1cdc93fa4f926c6537f84186edd85ca9 (diff)
downloadgit-fb4a8464a6d7ba643a8ebdb3ad8e1e84f0a01b0a.zip
git-fb4a8464a6d7ba643a8ebdb3ad8e1e84f0a01b0a.tar.gz
git-fb4a8464a6d7ba643a8ebdb3ad8e1e84f0a01b0a.tar.bz2
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>
-rw-r--r--builtin/checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 08b0ac4..1b672a9 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"));