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

[PATCH] subtree: initialize "prefix" variable

From
Jeff King <peff@peff.net>
Date
Mar 17, 2014, 19:59 UTC
Message-ID
<20140317195946.GA29839@sigill.intra.peff.net>
In-Reply-To
<5326F158.4050402@free.fr>
On Mon, Mar 17, 2014 at 01:58:00PM +0100, Gilles Filippini wrote:
> Test 21 from contrib/subtree/t/t7900-subtree.sh fails when an
> environment variable 'prefix' is set. For instance here is what happens
> when prefix=/usr:
I think it just needs the patch below.

-- >8 -- We parse the "--prefix" command-line option into the "$prefix" shell variable. However, if we do not see such an option, the variable is left with whatever value it had in the environment. We should initialize it to a known value, like we do for other variables.

Signed-off-by: Jeff King <peff@peff.net>
---
I checked, and this looks like the only variable in this situation.
 contrib/subtree/git-subtree.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index dc59a91..db925ca 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -46,6 +46,7 @@ ignore_joins=
 annotate=
 squash=
 message=
+prefix=
 
 debug()
 {
-- 
1.9.0.532.gc4c322d
Previous: Gilles FilippiniNext: Eric Sunshine
Message 2 of 5 in “[BUG] contrib/subtree: t/t7900-subtree.sh: test 21 fails when environment variable 'prefix' is set”
  1. Gilles FilippiniMar 17, 2014
  2. subtree: initialize "prefix" variableJeff King, Mar 17, 2014
  3. Eric SunshineMar 17, 2014
  4. Jeff KingMar 17, 2014
  5. Junio C HamanoMar 17, 2014

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.