aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-02-16 23:16:19 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-02-16 23:16:19 +0000
commitd187ff79e552e04c51da05856e1274e0edbb11ac (patch)
tree94e718e40faef37e2ca775a985f697daf415bf3e
parent25dc20a25946fa3187eeba65a96ff292e8a88359 (diff)
downloadpaludis-d187ff79e552e04c51da05856e1274e0edbb11ac.tar.gz
paludis-d187ff79e552e04c51da05856e1274e0edbb11ac.tar.xz
Don't rely on Perl.
-rw-r--r--paludis/syncers/dogit.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/paludis/syncers/dogit.in b/paludis/syncers/dogit.in
index 5005a1d..239bed7 100644
--- a/paludis/syncers/dogit.in
+++ b/paludis/syncers/dogit.in
@@ -85,7 +85,10 @@ fi
if [[ -d "${LOCAL}" ]]; then
cd "${LOCAL}"
- OLD_REMOTE="$(${GIT_WRAPPER} git remote show -n origin | sed -ne 's/^ *URL: //p')"
+ OLD_REMOTE="$(${GIT_WRAPPER} git config remote.origin.url)"
+ if [[ -z "${OLD_REMOTE}" && -f .git/remotes/origin ]]; then
+ OLD_REMOTE="$(sed -ne '/^URL: */{s/^URL: *//p;q}' .git/remotes/origin)"
+ fi
if [[ "${OLD_REMOTE}" != "${REMOTE}" ]]; then
if ! ${GIT_WRAPPER} git config remote.origin.url "${REMOTE}"; then
eerror "${0}: could not switch from '${OLD_REMOTE}' to '${REMOTE}'"