From: René Scharfe Date: Thu, 6 Apr 2017 20:41:41 +0000 (+0200) Subject: test-read-cache: setup git dir X-Git-Tag: v2.13.0-rc0~8^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/bccb22cbb15d45c940da4c54231949c722d4fe30 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 Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c index 2a7990efc3..48255eef31 100644 --- a/t/helper/test-read-cache.c +++ b/t/helper/test-read-cache.c @@ -5,6 +5,7 @@ int cmd_main(int argc, const char **argv) int i, cnt = 1; if (argc == 2) cnt = strtol(argv[1], NULL, 0); + setup_git_directory(); for (i = 0; i < cnt; i++) { read_cache(); discard_cache();