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 --- preload-index.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'preload-index.c') diff --git a/preload-index.c b/preload-index.c index c7dc3f2b9f..e73600ee78 100644 --- a/preload-index.c +++ b/preload-index.c @@ -8,6 +8,7 @@ #include "config.h" #include "progress.h" #include "thread-utils.h" +#include "repository.h" /* * Mostly randomly chosen maximum thread counts: we @@ -146,12 +147,12 @@ void preload_index(struct index_state *index, trace_performance_leave("preload index"); } -int read_index_preload(struct index_state *index, - const struct pathspec *pathspec, - unsigned int refresh_flags) +int repo_read_index_preload(struct repository *repo, + const struct pathspec *pathspec, + unsigned int refresh_flags) { - int retval = read_index(index); + int retval = repo_read_index(repo); - preload_index(index, pathspec, refresh_flags); + preload_index(repo->index, pathspec, refresh_flags); return retval; } -- cgit v1.2.3