Skip to content

Commit bccb22c

Browse files
rscharfegitster
authored andcommitted
test-read-cache: setup git dir
b1ef400 (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 <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3e8b7d3 commit bccb22c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/helper/test-read-cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ int cmd_main(int argc, const char **argv)
55
int i, cnt = 1;
66
if (argc == 2)
77
cnt = strtol(argv[1], NULL, 0);
8+
setup_git_directory();
89
for (i = 0; i < cnt; i++) {
910
read_cache();
1011
discard_cache();

0 commit comments

Comments
 (0)