git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] t5410: use longer path for sample script

From
Jeff King <peff@peff.net>
Date
Oct 24, 2018, 07:37 UTC
Message-ID
<20181024073705.GA31202@sigill.intra.peff.net>
In-Reply-To
<20181024073637.GA31069@sigill.intra.peff.net>

t5410 creates a sample script "alternate-refs", and sets core.alternateRefsCommand to just "alternate-refs". That shouldn't work, as "." is not in our $PATH, and so we should not find it.

However, due to a bug in run-command.c, we sometimes find it anyway! Even more confusing, this bug is only in the fork-based version of run-command. So the test passes on Linux (etc), but fails on Windows.

In preparation for fixing the run-command bug, let's use a more complete path here.

Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5410-receive-pack-alternates.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5410-receive-pack-alternates.sh b/t/t5410-receive-pack-alternates.sh
index 457c20c2a5..f00d0da860 100755
--- a/t/t5410-receive-pack-alternates.sh
+++ b/t/t5410-receive-pack-alternates.sh
@@ -23,7 +23,7 @@ test_expect_success 'with core.alternateRefsCommand' '
 			--format="%(objectname)" \
 			refs/heads/public/
 	EOF
-	test_config -C fork core.alternateRefsCommand alternate-refs &&
+	test_config -C fork core.alternateRefsCommand ./alternate-refs &&
 	git rev-parse public/branch >expect &&
 	printf "0000" | git receive-pack fork >actual &&
 	extract_haves <actual >actual.haves &&
-- 
2.19.1.1094.gd480080bf6
Previous: Jeff KingNext: Johannes Schindelin
Message 2 of 8 in “run-command: fix Unix PATH lookup”
  1. 0/2 run-command: fix Unix PATH lookupJeff King, Oct 24, 2018
  2. 1/2 t5410: use longer path for sample scriptJeff King, Oct 24, 2018
  3. Johannes SchindelinOct 24, 2018
  4. Junio C HamanoOct 25, 2018
  5. 2/2 run-command: mark path lookup errors with ENOENTJeff King, Oct 24, 2018
  6. Johannes SchindelinOct 24, 2018
  7. Jeff KingOct 24, 2018
  8. Johannes SchindelinOct 24, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.