test-*-cache-tree: setup git dir
These test helper programs access the index, but do not ever setup_git_directory(), meaning we just blindly looked in ".git/index". This happened to work for the purposes of our tests (which do not run from subdirectories, nor in non-repos), but it's a bad habit. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f0056f6419
commit
4ce742fc9c
@ -58,6 +58,7 @@ int cmd_main(int ac, const char **av)
|
||||
{
|
||||
struct index_state istate;
|
||||
struct cache_tree *another = cache_tree();
|
||||
setup_git_directory();
|
||||
if (read_cache() < 0)
|
||||
die("unable to read index file");
|
||||
istate = the_index;
|
||||
|
Reference in New Issue
Block a user