scripts: sources-branch-updater: Make regexp for master branch stricter

The regexp does not work properly when the upstream repo has many
branches named 'master' such as ceph-ansible

0fa368a7441528457b7bcb99f8a860d7987b9ba6 refs/heads/guits-update_req_master
79bd06ad28d8a078bd95923b230eb8d5b66095b2 refs/heads/master

which breaks the script when bumping SHAs. As such, lets make it
stricter by simply matching /master$ instead.

Change-Id: I24526a358d7a21821f8c9789ba199863981f8d7b
This commit is contained in:
Markos Chandras 2018-10-05 16:48:04 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 843eeb4d2e
commit a9c72408be

View File

@ -259,7 +259,7 @@ update_ansible_role_requirements() {
# If we are forcing master and we still don't have a role_version defined, then we need
# to fallback to master branch
if [[ -z "${role_version}" ]] && [[ "${force_master}" == "true" ]]; then
role_version=$(git ls-remote ${role_src} | grep master | awk '{print $1}')
role_version=$(git ls-remote ${role_src} | grep /master$ | awk '{print $1}')
fi
# For OSA roles, get the release notes