parse-remote: do not barf on a remote shorthand without any refs to fetch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 25, 2007 at 21:50 UTC
ae9c6ffe3039fc4d0a89eb253800b3ca58830bb2
1 file changed
+8
-1
git-parse-remote.sh
+8
-1
@@ -81,7 +81,14 @@ get_remote_default_refs_for_push () {
81
# is to help prevent randomly "globbed" ref from being chosen as
82
# a merge candidate
83
expand_refs_wildcard () {
84
+ remote="$1"
85
+ shift
86
first_one=yes
87
+ if test "$#" = 0
88
+ then
89
+ echo empty
90
+ echo >&2 "Nothing specified for fetching with remote.$remote.fetch"
91
+ fi
92
for ref
93
do
94
lref=${ref#'+'}
@@ -132,7 +139,7 @@ canon_refs_list_for_fetch () {
139
if test "$1" = "-d"
140
then
141
shift ; remote="$1" ; shift
135
- set $(expand_refs_wildcard "$@")
142
+ set $(expand_refs_wildcard "$remote" "$@")
143
is_explicit="$1"
144
shift
145
if test "$remote" = "$(get_default_remote)"