git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Joey Hess <id@joeyh.name>,
	Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH] pull.sh: quote $upload_pack when passing it to git-fetch
Date: Thu, 30 Jul 2015 22:40:03 +0200	[thread overview]
Message-ID: <1438288803-17953-1-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <CAPc5daXPY7RQSM6oyFYJ2LjYjaT9dDG-+3=nbHONirGh50pdBA@mail.gmail.com>

The previous code broke for example

  git pull --upload-pack 'echo --foo'

Reported-by: Joey Hess <id@joeyh.name>
Fix-suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Junio wrote:
> ${upload_pack+"$upload_pack"} or something.

Indeed, we need to pass nothing, not the empty string if $upload_pack
is not defined.

This should fix it.

 git-pull.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-pull.sh b/git-pull.sh
index a814bf6..26c5e9f 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -295,7 +295,7 @@ test true = "$rebase" && {
 }
 orig_head=$(git rev-parse -q --verify HEAD)
 git fetch $verbosity $progress $dry_run $recurse_submodules $all $append \
-$upload_pack $force $tags $prune $keep $depth $unshallow $update_shallow \
+${upload_pack+"$upload_pack"} $force $tags $prune $keep $depth $unshallow $update_shallow \
 $refmap --update-head-ok "$@" || exit 1
 test -z "$dry_run" || exit 0
 
-- 
2.5.0.rc0.7.ge1edd74.dirty

  reply	other threads:[~2015-07-30 20:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 15:45 git pull --upload-pack reversion in git 2.5.0 Joey Hess
2015-07-30 17:17 ` Matthieu Moy
2015-07-30 18:31   ` Joey Hess
2015-07-30 18:41     ` Junio C Hamano
2015-07-30 20:40       ` Matthieu Moy [this message]
2015-07-30 21:13         ` [PATCH] pull.sh: quote $upload_pack when passing it to git-fetch Junio C Hamano
2015-07-31 11:01         ` Paul Tan
2015-07-31 17:54       ` git pull --upload-pack reversion in git 2.5.0 Junio C Hamano

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=1438288803-17953-1-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=id@joeyh.name \
    /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 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).