osmo-ci/scripts/osmo-deps.sh

21 lines
442 B
Bash
Raw Normal View History

2016-04-24 09:24:30 +00:00
#!/bin/sh
set -ex
project="$1"
branch="${2:-origin/master}"
2016-04-24 09:24:30 +00:00
if ! test -d "$project";
2016-04-24 09:24:30 +00:00
then
git clone "git://git.osmocom.org/$project" "$project"
2016-04-24 09:24:30 +00:00
fi
cd "$project"
2016-04-24 09:24:30 +00:00
git fetch origin
# Cleanup should already have happened during a global osmo-clean-workspace.sh,
# but in case the caller did not (want to) call that, let's also do cleanup in
# the dep subdir separately:
osmo-clean-workspace.sh
git reset --hard "$branch"
git rev-parse HEAD