test-read-cache: setup git dir
authorRené Scharfe <l.s.r@web.de>
Thu, 6 Apr 2017 20:41:41 +0000 (22:41 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Apr 2017 03:05:11 +0000 (20:05 -0700)
commitbccb22cbb15d45c940da4c54231949c722d4fe30
tree6b6fca24da2025b24a892d59f7db5f737b44dfbb
parent3e8b7d3c77c464b29f7f3e0627ca7354f7de433a
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>
t/helper/test-read-cache.c