coverity: Don't start with a new clone, but simply fetch/checkout

If a given git clone already exists, simply do a fetch + checkout -f,
rather than cloning a decade worth of history from scratch.

Change-Id: Icecb2d00a75bc303d84efafee5c1f2d52ba1b6b3
This commit is contained in:
Harald Welte 2017-10-11 08:16:03 +08:00
parent 5b05a88bb3
commit 6853b7dac1
1 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,8 @@
#!/bin/sh
mkdir -p source-Osmocom
BASEDIR=source-Osmocom
cd source-Osmocom
[ -d $BASEDIR ] || mkdir -p $BASEDIR
cd $BASEDIR
for proj in \
asn1c \
@ -23,7 +24,11 @@ for proj in \
osmo-hlr \
; do
git clone git://git.osmocom.org/$proj
if [ -d $proj ]; then
(cd $proj && git fetch && git checkout -f -B master origin/master)
else
git clone git://git.osmocom.org/$proj
fi
done
git clone git://git.sysmocom.de/sysmo-bts/layer1-api