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>
This commit is contained in:
committed by
Junio C Hamano
parent
fb4a8464a6
commit
e1ff0a32e4
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user