diff --git a/utils/githooks/find_base.sh b/utils/githooks/find_base.sh index 5ab1e8b624f..292a02f66e7 100644 --- a/utils/githooks/find_base.sh +++ b/utils/githooks/find_base.sh @@ -37,6 +37,7 @@ if [ -z "$TARGET" ]; then # as the target, calculated as the sum of the commits this branch is ahead and # behind. # check master, then current release branches, then current feature branches. + export ORIGIN TARGET="$ORIGIN/$(utils/rpms/packaging/get_release_branch "feature/cat_recovery feature/multiprovider")" echo " Install gh command to auto-detect target branch, assuming $TARGET." fi diff --git a/utils/rpms/packaging/get_release_branch b/utils/rpms/packaging/get_release_branch index 334c4f0e2d9..e017cca2071 100755 --- a/utils/rpms/packaging/get_release_branch +++ b/utils/rpms/packaging/get_release_branch @@ -3,10 +3,9 @@ # find the base branch of the current branch # base branches can be master, release/2.4+, release/3+ # or optionally branches passed into $1 - set -eu -o pipefail IFS=' ' read -r -a add_bases <<< "${1:-}" -origin=origin +origin="${ORIGIN:-origin}" mapfile -t all_bases < <(echo "master" git branch -r | sed -ne "/^ $origin\\/release\\/\(2.[4-9]\|[3-9]\)/s/^ $origin\\///p") all_bases+=("${add_bases[@]}")