diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-01-12 03:13:26 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-14 21:13:04 +0100 |
commit | e1ff0a32e48eb0f3e53970df3f941d183093ff5a (patch) | |
tree | b9d9a617170b562f93a9d262443a8bc45834ed74 /sha1-name.c | |
parent | checkout: avoid the_index when possible (diff) | |
download | git-e1ff0a32e48eb0f3e53970df3f941d183093ff5a.tar.xz git-e1ff0a32e48eb0f3e53970df3f941d183093ff5a.zip |
read-cache.c: kill read_index()
read_index() shares the same problem as hold_locked_index(): it
assumes $GIT_DIR/index. Move all call sites to repo_read_index()
instead. read_index_preload() and read_index_unmerged() are also
killed as a consequence.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | sha1-name.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sha1-name.c b/sha1-name.c index b24502811b..a0fc1008ec 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -1723,9 +1723,9 @@ static int get_oid_with_context_1(const char *name, if (flags & GET_OID_RECORD_PATH) oc->path = xstrdup(cp); - if (!active_cache) - read_cache(); - pos = cache_name_pos(cp, namelen); + if (!the_index.cache) + repo_read_index(the_repository); + pos = index_name_pos(&the_index, cp, namelen); if (pos < 0) pos = -pos - 1; while (pos < active_nr) { |