test-read-cache: setup git dir
b1ef400e (setup_git_env: avoid blind fall-back to ".git") made programs that tried to access a repository without initializing properly die with a diagnostic message. One offender is test-read-cache, which is used in p0002. Fix it by calling setup_git_directory() before accessing the index. Signed-off-by: Rene Scharfe <l.s.r@web.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Apr 6, 2017 at 22:41 UTC
bccb22cbb15d45c940da4c54231949c722d4fe30
1 file changed
+1
t/helper/test-read-cache.c
+1
@@ -5,6 +5,7 @@ int cmd_main(int argc, const char **argv)
5
int i, cnt = 1;
6
if (argc == 2)
7
cnt = strtol(argv[1], NULL, 0);
8
+ setup_git_directory();
9
for (i = 0; i < cnt; i++) {
10
read_cache();
11
discard_cache();