Git fork

git-submodule - Fix errors regarding resolve_relative_url

git-submodule was invoking "die" from within resolve-relative-url, but
this does not actually cause the script to exit. Fix this by returning
the error to the caller and have the caller exit.

While we're at it, clean up the quoting on invocation of
resolve_relative_url as it was wrong.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Mark Levedahl and committed by
Junio C Hamano
8e7e6f39 65e73dba

+5 -4
+5 -4
git-submodule.sh
··· 45 45 branch="$(git symbolic-ref HEAD 2>/dev/null)" 46 46 remote="$(git config branch.${branch#refs/heads/}.remote)" 47 47 remote="${remote:-origin}" 48 - remoteurl="$(git config remote.$remote.url)" || 49 - die "remote ($remote) does not have a url in .git/config" 48 + remoteurl=$(git config "remote.$remote.url") || 49 + die "remote ($remote) does not have a url defined in .git/config" 50 50 url="$1" 51 51 while test -n "$url" 52 52 do ··· 178 178 case "$repo" in 179 179 ./*|../*) 180 180 # dereference source url relative to parent's url 181 - realrepo="$(resolve_relative_url $repo)" ;; 181 + realrepo=$(resolve_relative_url "$repo") || exit 182 + ;; 182 183 *) 183 184 # Turn the source into an absolute path if 184 185 # it is local ··· 246 247 # Possibly a url relative to parent 247 248 case "$url" in 248 249 ./*|../*) 249 - url="$(resolve_relative_url "$url")" 250 + url=$(resolve_relative_url "$url") || exit 250 251 ;; 251 252 esac 252 253