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 --- rerere.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rerere.c') diff --git a/rerere.c b/rerere.c index fb0fdb2392..17abb47321 100644 --- a/rerere.c +++ b/rerere.c @@ -561,7 +561,7 @@ static int find_conflict(struct repository *r, struct string_list *conflict) { int i; - if (read_index(r->index) < 0) + if (repo_read_index(r) < 0) return error(_("index file corrupt")); for (i = 0; i < r->index->cache_nr;) { @@ -595,7 +595,7 @@ int rerere_remaining(struct repository *r, struct string_list *merge_rr) if (setup_rerere(r, merge_rr, RERERE_READONLY)) return 0; - if (read_index(r->index) < 0) + if (repo_read_index(r) < 0) return error(_("index file corrupt")); for (i = 0; i < r->index->cache_nr;) { @@ -1107,7 +1107,7 @@ int rerere_forget(struct repository *r, struct pathspec *pathspec) struct string_list conflict = STRING_LIST_INIT_DUP; struct string_list merge_rr = STRING_LIST_INIT_DUP; - if (read_index(r->index) < 0) + if (repo_read_index(r) < 0) return error(_("index file corrupt")); fd = setup_rerere(r, &merge_rr, RERERE_NOAUTOUPDATE); -- cgit v1.2.3