summaryrefslogtreecommitdiff
path: root/t/helper/test-read-cache.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-04-06 20:41:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-17 03:05:11 (GMT)
commitbccb22cbb15d45c940da4c54231949c722d4fe30 (patch)
tree6b6fca24da2025b24a892d59f7db5f737b44dfbb /t/helper/test-read-cache.c
parent3e8b7d3c77c464b29f7f3e0627ca7354f7de433a (diff)
downloadgit-bccb22cbb15d45c940da4c54231949c722d4fe30.zip
git-bccb22cbb15d45c940da4c54231949c722d4fe30.tar.gz
git-bccb22cbb15d45c940da4c54231949c722d4fe30.tar.bz2
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>
Diffstat (limited to 't/helper/test-read-cache.c')
-rw-r--r--t/helper/test-read-cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c
index 2a7990e..48255ee 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();