summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-01-12 02:13:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-14 20:13:04 (GMT)
commite1ff0a32e48eb0f3e53970df3f941d183093ff5a (patch)
treeb9d9a617170b562f93a9d262443a8bc45834ed74 /revision.c
parentfb4a8464a6d7ba643a8ebdb3ad8e1e84f0a01b0a (diff)
downloadgit-e1ff0a32e48eb0f3e53970df3f941d183093ff5a.zip
git-e1ff0a32e48eb0f3e53970df3f941d183093ff5a.tar.gz
git-e1ff0a32e48eb0f3e53970df3f941d183093ff5a.tar.bz2
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 'revision.c')
-rw-r--r--revision.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/revision.c b/revision.c
index 13e0519..c51ea6a 100644
--- a/revision.c
+++ b/revision.c
@@ -1384,7 +1384,7 @@ void add_index_objects_to_pending(struct rev_info *revs, unsigned int flags)
{
struct worktree **worktrees, **p;
- read_index(revs->repo->index);
+ repo_read_index(revs->repo);
do_add_index_objects_to_pending(revs, revs->repo->index, flags);
if (revs->single_worktree)
@@ -1530,7 +1530,7 @@ static void prepare_show_merge(struct rev_info *revs)
head->object.flags |= SYMMETRIC_LEFT;
if (!istate->cache_nr)
- read_index(istate);
+ repo_read_index(revs->repo);
for (i = 0; i < istate->cache_nr; i++) {
const struct cache_entry *ce = istate->cache[i];
if (!ce_stage(ce))