From a9c72408bef1508fe26f515db02e347892ed8618 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 5 Oct 2018 16:48:04 +0100 Subject: [PATCH] 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 --- scripts/sources-branch-updater-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sources-branch-updater-lib.sh b/scripts/sources-branch-updater-lib.sh index da2ac5ce58..7f6ba2d33c 100644 --- a/scripts/sources-branch-updater-lib.sh +++ b/scripts/sources-branch-updater-lib.sh @@ -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