From e1ff0a32e48eb0f3e53970df3f941d183093ff5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 12 Jan 2019 09:13:26 +0700 Subject: read-cache.c: kill read_index() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- blame.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'blame.c') diff --git a/blame.c b/blame.c index 43861437f7..da57233cbb 100644 --- a/blame.c +++ b/blame.c @@ -188,7 +188,7 @@ static struct commit *fake_working_tree_commit(struct repository *r, unsigned mode; struct strbuf msg = STRBUF_INIT; - read_index(r->index); + repo_read_index(r); time(&now); commit = alloc_commit_node(r); commit->object.parsed = 1; @@ -270,7 +270,7 @@ static struct commit *fake_working_tree_commit(struct repository *r, * want to run "diff-index --cached". */ discard_index(r->index); - read_index(r->index); + repo_read_index(r); len = strlen(path); if (!mode) { -- cgit v1.2.3