summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Levedahl <mlevedahl@gmail.com>2008-08-24 18:46:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-24 19:08:11 (GMT)
commit98fcf840af443a0a93b9a6cd1fada5af826383f3 (patch)
tree05ec8519c1bbaa683607b6c119b48bc66d3b6fbe
parentd6096f17d2d5d9ccb453aabf8edc6ee238b166fc (diff)
downloadgit-98fcf840af443a0a93b9a6cd1fada5af826383f3.zip
git-98fcf840af443a0a93b9a6cd1fada5af826383f3.tar.gz
git-98fcf840af443a0a93b9a6cd1fada5af826383f3.tar.bz2
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>
-rwxr-xr-xgit-submodule.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 2a3a197..59fe7b3 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -9,6 +9,7 @@ USAGE="[--quiet] [--cached] \
[--] [<path>...]|[foreach <command>]"
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"