From 5cd15291823fbad38a1f6cf24e7d020afceae7ab Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 30 Mar 2018 02:05:15 +0200 Subject: 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 --- scripts/osmo-deps.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/osmo-deps.sh') 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 -- cgit v1.2.3