Skip to content

Commit

Permalink
git-submodule - Use "get_default_remote" from git-parse-remote
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Levedahl authored and Junio C Hamano committed Aug 24, 2008
1 parent d6096f1 commit 98fcf84
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ USAGE="[--quiet] [--cached] \
[--] [<path>...]|[foreach <command>]"
OPTIONS_SPEC=
. git-sh-setup
. git-parse-remote
require_work_tree

command=
Expand All @@ -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"
Expand Down

0 comments on commit 98fcf84

Please sign in to comment.