summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-03-30 02:05:15 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-04-02 19:35:36 +0000
commit5cd15291823fbad38a1f6cf24e7d020afceae7ab (patch)
tree3ef32d7fb354e530c94c9edda9b0ea6167148036 /scripts
parent482c99223e410246538bd462ac28e79fc4ee1b39 (diff)
scripts: osmo-deps.sh: Allow building against tags
In case we provide a tag, origin/$tag doesn't resolve correctly, we must use $tag. Same happens probably if we want to build against a specific commit hash. Change-Id: Ica50080c8b3e20686fe6f47a2b61718ef4a66d95
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/osmo-deps.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh
index a4afec5..5a7dcc2 100755
--- a/scripts/osmo-deps.sh
+++ b/scripts/osmo-deps.sh
@@ -1,7 +1,12 @@
#!/bin/sh
set -ex
project="$1"
-branch="origin/${2:-master}"
+branch="${2:-master}"
+# If ref is really a branch, we want to track the remote one:
+if [ "x$(git branch -a | grep -c "remotes/origin/$branch\$")" != "x0" ]; then
+ branch="origin/$branch"
+fi
+
if ! test -d "$project";
then