From: Junio C Hamano <gitster@pobox.com>
To: Gilles Filippini <gilles.filippini@free.fr>
Cc: git@vger.kernel.org, "David A. Greene" <greened@obbligato.org>
Subject: Re: [BUG] contrib/subtree: t/t7900-subtree.sh: test 21 fails when environment variable 'prefix' is set
Date: Mon, 17 Mar 2014 13:44:07 -0700 [thread overview]
Message-ID: <xmqqiorcd088.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5326F158.4050402@free.fr> (Gilles Filippini's message of "Mon, 17 Mar 2014 13:58:00 +0100")
Gilles Filippini <gilles.filippini@free.fr> writes:
> 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:
>
> expecting success:
> echo "You must provide the --prefix option." > expected &&
> test_must_fail git subtree split > actual 2>&1 &&
> test_debug "printf 'expected: '" &&
> test_debug "cat expected" &&
> test_debug "printf 'actual: '" &&
> test_debug "cat actual" &&
> test_cmp expected actual &&
> rm -f expected actual
>
> --- expected 2014-03-17 10:39:34.907594853 +0000
> +++ actual 2014-03-17 10:39:34.979595322 +0000
> @@ -1 +1,9 @@
> -You must provide the --prefix option.
> fatal: /usr: '/usr' is outside repository
> fatal: /usr: '/usr' is outside repository
> fatal: /usr: '/usr' is outside repository
> fatal: /usr: '/usr' is outside repository
> fatal: /usr: '/usr' is outside repository
> fatal: /usr: '/usr' is outside repository
> fatal: /usr: '/usr' is outside repository
> fatal: /usr: '/usr' is outside repository
> +No new revisions were found
> not ok 21 - Check that prefix argument is required for split
Thanks. Although I do not use nor touch git-subtree, I am
reasonably confident that this patch should fix it.
-- >8 --
Subject: subtree: initialise all variables to known state
Parsing the command line options may set prefix to the given value
with --prefix=value or an empty string with --no-prefix, but the
script forgets to protect against a stray environment variable.
Make sure all the variables that can be assigned in the command line
parsing are initialized to empty.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
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 7d7af03..90e0b7e 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -46,6 +46,7 @@ ignore_joins=
annotate=
squash=
message=
+prefix=
debug()
{
prev parent reply other threads:[~2014-03-17 20:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 12:58 [BUG] contrib/subtree: t/t7900-subtree.sh: test 21 fails when environment variable 'prefix' is set Gilles Filippini
2014-03-17 19:59 ` [PATCH] subtree: initialize "prefix" variable Jeff King
2014-03-17 20:08 ` Eric Sunshine
2014-03-17 20:56 ` Jeff King
2014-03-17 20:44 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqiorcd088.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=gilles.filippini@free.fr \
--cc=git@vger.kernel.org \
--cc=greened@obbligato.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.