aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/osmo-deps.sh
blob: 92cf041657cb99d7f0b18c4acb75bf640447660b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -ex
project="$1"
branch="${2:-origin/master}"

if ! test -d "$project";
then
  git clone "git://git.osmocom.org/$project" "$project"
fi

cd "$project"
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