{"thread":{"id":"45626","subject":"[PATCH] test-read-cache: setup git dir","startedAt":"2017-04-06T20:42:05Z","lastAt":"2017-04-07T05:23:02Z","messageCount":2,"participants":["René Scharfe","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"316306","messageId":"020feb89-be3e-1261-d9b5-cad7c38ef2f0@web.de","threadId":"45626","inReplyTo":null,"subject":"[PATCH] test-read-cache: setup git dir","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2017-04-06T20:41:41Z","receivedAt":"2017-04-06T20:42:05Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"b1ef400e (setup_git_env: avoid blind fall-back to \".git\") made programs\nthat tried to access a repository without initializing properly die with\na diagnostic message.  One offender is test-read-cache, which is used in\np0002.  Fix it by calling setup_git_directory() before accessing the\nindex.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n t/helper/test-read-cache.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c\nindex 2a7990efc3..48255eef31 100644\n--- a/t/helper/test-read-cache.c\n+++ b/t/helper/test-read-cache.c\n@@ -5,6 +5,7 @@ int cmd_main(int argc, const char **argv)\n \tint i, cnt = 1;\n \tif (argc == 2)\n \t\tcnt = strtol(argv[1], NULL, 0);\n+\tsetup_git_directory();\n \tfor (i = 0; i < cnt; i++) {\n \t\tread_cache();\n \t\tdiscard_cache();\n-- \n2.12.2\n\n"},{"id":"316322","messageId":"20170407052255.vc6ch633zcdiplgy@sigill.intra.peff.net","threadId":"45626","inReplyTo":"020feb89-be3e-1261-d9b5-cad7c38ef2f0@web.de","subject":"Re: [PATCH] test-read-cache: setup git dir","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-04-07T05:22:55Z","receivedAt":"2017-04-07T05:23:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 06, 2017 at 10:41:41PM +0200, René Scharfe wrote:\n\n> b1ef400e (setup_git_env: avoid blind fall-back to \".git\") made programs\n> that tried to access a repository without initializing properly die with\n> a diagnostic message.  One offender is test-read-cache, which is used in\n> p0002.  Fix it by calling setup_git_directory() before accessing the\n> index.\n\nRight, makes sense. I wondered why we didn't notice this before, but\nit's because it's _only_ called from the perf suite.\n\n-Peff\n"}]}