pull: pass upload_pack only when it was given
authorJunio C Hamano <gitster@pobox.com>
Tue, 25 Aug 2015 23:06:53 +0000 (16:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Aug 2015 23:08:58 +0000 (16:08 -0700)
The upload_pack shell variable is initialized to an empty string, so
conditional expansion with ${upload_pack+"$upload_pack"} would not
work very well. You need a colon there.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-pull.sh
index 26c5e9ff61477ae523a63b34dcefbc322212a0a7..e8dc2e0e7d5d8fb37f818a05c3ef4c58f28850da 100755 (executable)
@@ -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 \
 }
 orig_head=$(git rev-parse -q --verify HEAD)
 git fetch $verbosity $progress $dry_run $recurse_submodules $all $append \
-${upload_pack+"$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
 
 $refmap --update-head-ok "$@" || exit 1
 test -z "$dry_run" || exit 0