From: Mark Levedahl Date: Sun, 24 Aug 2008 18:46:10 +0000 (-0400) Subject: git-submodule - Use "get_default_remote" from git-parse-remote X-Git-Tag: v1.6.1-rc1~309 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98fcf840af443a0a93b9a6cd1fada5af826383f3;p=git.git git-submodule - Use "get_default_remote" from git-parse-remote Resolve_relative_url was using its own code for this function, but this is duplication with the best result that this continues to work. Replace with the common function provided by git-parse-remote. Signed-off-by: Mark Levedahl Signed-off-by: Junio C Hamano --- diff --git a/git-submodule.sh b/git-submodule.sh index 2a3a197d1..59fe7b335 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -9,6 +9,7 @@ USAGE="[--quiet] [--cached] \ [--] [...]|[foreach ]" OPTIONS_SPEC= . git-sh-setup +. git-parse-remote require_work_tree command= @@ -30,9 +31,7 @@ say() # Resolve relative url by appending to parent's url resolve_relative_url () { - branch="$(git symbolic-ref HEAD 2>/dev/null)" - remote="$(git config branch.${branch#refs/heads/}.remote)" - remote="${remote:-origin}" + remote=$(get_default_remote) remoteurl=$(git config "remote.$remote.url") || die "remote ($remote) does not have a url defined in .git/config" url="$1"