Re: [PATCH] pull.sh: quote $upload_pack when passing it to git-fetch
On Fri, Jul 31, 2015 at 4:40 AM, Matthieu Moy matthieu@imag.fr wrote: The previous code broke for example git pull --upload-pack 'echo --foo' Reported-by: Joey Hess i...@joeyh.name Fix-suggested-by: Junio C Hamano gits...@pobox.com Signed-off-by: Matthieu Moy matthieu@imag.fr Thanks for cleaning up my mess! Regards, Paul -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] pull.sh: quote $upload_pack when passing it to git-fetch
The previous code broke for example git pull --upload-pack 'echo --foo' Reported-by: Joey Hess i...@joeyh.name Fix-suggested-by: Junio C Hamano gits...@pobox.com Signed-off-by: Matthieu Moy matthieu@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 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] pull.sh: quote $upload_pack when passing it to git-fetch
Matthieu Moy matthieu@imag.fr writes: The previous code broke for example git pull --upload-pack 'echo --foo' Reported-by: Joey Hess i...@joeyh.name Fix-suggested-by: Junio C Hamano gits...@pobox.com Signed-off-by: Matthieu Moy matthieu@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. The problematic commit touches a lot more than upload-pack, but all others that take user-supplied strings are meant for git merge or git rebase that are properly quoted and then eval'ed, so this should be sufficient. Thanks. 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 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html