diff options
author | Jeff King <peff@peff.net> | 2016-10-20 08:16:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-26 22:30:51 +0200 |
commit | 4ce742fc9c09cd3b95be309bc093f8fa54c15f96 (patch) | |
tree | 8e6736889ceefd7243cf864059372c6ee9ef67b6 /t/helper/test-scrap-cache-tree.c | |
parent | read info/{attributes,exclude} only when in repository (diff) | |
download | git-4ce742fc9c09cd3b95be309bc093f8fa54c15f96.tar.xz git-4ce742fc9c09cd3b95be309bc093f8fa54c15f96.zip |
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>
Diffstat (limited to 't/helper/test-scrap-cache-tree.c')
-rw-r--r-- | t/helper/test-scrap-cache-tree.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c index 5b2fd09908..27fe0405b8 100644 --- a/t/helper/test-scrap-cache-tree.c +++ b/t/helper/test-scrap-cache-tree.c @@ -7,6 +7,7 @@ static struct lock_file index_lock; int cmd_main(int ac, const char **av) { + setup_git_directory(); hold_locked_index(&index_lock, 1); if (read_cache() < 0) die("unable to read index file"); |