update-common: read the url to push to from config
authorThomas Vander Stichele <thomas (at) apestaart (dot) org>
Wed, 25 Jan 2012 13:20:52 +0000 (14:20 +0100)
committerThomas Vander Stichele <thomas (at) apestaart (dot) org>
Wed, 25 Jan 2012 13:24:53 +0000 (14:24 +0100)
update-common

index 0d56dcd..3482c1f 100755 (executable)
@@ -16,6 +16,7 @@
 # git # checkouts, and git will pull objects from there, decreasing
 # network usage.
 reference=~/gst
+PUSHURL=ssh://git.freedesktop.org/git/gstreamer
 
 set -e
 set -x
@@ -31,11 +32,17 @@ for module in $modules
 do
   cd $dir
   if test -e $reference/$module/.git ; then
+    pushd $reference/$module
+    PUSHURL=`git config remote.origin.url | sed 's@\(git/gstreamer\).*@\1@'`
+    popd
     git clone --reference $reference/$module/.git --shared ssh://git.freedesktop.org/git/gstreamer/$module
   elif test -e $topdir/$module/.git ; then
-    git clone --reference $topdir/$module/.git --shared ssh://git.freedesktop.org/git/gstreamer/$module
+    pushd $topdir/$module
+    PUSHURL=`git config remote.origin.url | sed 's@\(git/gstreamer\).*@\1@'`
+    popd
+    git clone --reference $topdir/$module/.git --shared $PUSHURL/$module
   else
-    git clone ssh://git.freedesktop.org/git/gstreamer/$module
+    git clone $PUSHURL/$module
   fi
   cd $dir/$module
   git submodule init