@matheusbsbs / matheus-bagliano / commits / 98fcf840af
Fork 0

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 <mlevedahl@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mark Levedahl committed Aug 24, 2008 at 14:46 UTC 98fcf840af443a0a93b9a6cd1fada5af826383f3
1 file changed +2 -3
git-submodule.sh
+2 -3
@@ -9,6 +9,7 @@ USAGE="[--quiet] [--cached] \
9 [--] [<path>...]|[foreach <command>]"
10 OPTIONS_SPEC=
11 . git-sh-setup
12 +. git-parse-remote
13 require_work_tree
14
15 command=
@@ -30,9 +31,7 @@ say()
31 # Resolve relative url by appending to parent's url
32 resolve_relative_url ()
33 {
33 - branch="$(git symbolic-ref HEAD 2>/dev/null)"
34 - remote="$(git config branch.${branch#refs/heads/}.remote)"
35 - remote="${remote:-origin}"
34 + remote=$(get_default_remote)
35 remoteurl=$(git config "remote.$remote.url") ||
36 die "remote ($remote) does not have a url defined in .git/config"
37 url="$1"