# Set this variable to point to any directory containing existing
# git # checkouts, and git will pull objects from there, decreasing
# network usage.
+BRANCH=0.11
reference=~/gst
+ PUSHURL=ssh://git.freedesktop.org/git/gstreamer
set -e
set -x
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
+
+ # ignore modules that don't have such a branch
+ if ! git show-ref origin/$BRANCH >/dev/null; then
+ continue;
+ fi
+
+ git checkout -b $BRANCH origin/$BRANCH
git submodule init
git submodule update
cd $dir/$module/common