git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] test-read-cache: setup git dir
@ 2017-04-06 20:41 René Scharfe
  2017-04-07  5:22 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: René Scharfe @ 2017-04-06 20:41 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano, Jeff King, Jeff Hostetler

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>
---
 t/helper/test-read-cache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c
index 2a7990efc3..48255eef31 100644
--- a/t/helper/test-read-cache.c
+++ b/t/helper/test-read-cache.c
@@ -5,6 +5,7 @@ int cmd_main(int argc, const char **argv)
 	int i, cnt = 1;
 	if (argc == 2)
 		cnt = strtol(argv[1], NULL, 0);
+	setup_git_directory();
 	for (i = 0; i < cnt; i++) {
 		read_cache();
 		discard_cache();
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test-read-cache: setup git dir
  2017-04-06 20:41 [PATCH] test-read-cache: setup git dir René Scharfe
@ 2017-04-07  5:22 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2017-04-07  5:22 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git List, Junio C Hamano, Jeff Hostetler

On Thu, Apr 06, 2017 at 10:41:41PM +0200, René Scharfe wrote:

> 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.

Right, makes sense. I wondered why we didn't notice this before, but
it's because it's _only_ called from the perf suite.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-07  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06 20:41 [PATCH] test-read-cache: setup git dir René Scharfe
2017-04-07  5:22 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).