Skip to content

Commit ae830ef

Browse files
committed
Generalize branch name in scripts
1 parent d3473f0 commit ae830ef

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/ci/scripts/checkout-submodules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ci_dir=$(cd $(dirname $0) && pwd)/..
1717
# On the beta channel we'll be automatically calculating the prerelease version
1818
# via the git history, so unshallow our shallow clone from CI.
1919
if [ "$(releaseChannel)" = "beta" ]; then
20-
git fetch origin --unshallow beta master
20+
git fetch origin --unshallow beta HEAD
2121
fi
2222

2323
function fetch_github_commit_archive {

src/ci/scripts/verify-backported-commits.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
2-
# Ensure commits in beta are in master & commits in stable are in beta + master.
2+
# Ensure commits in beta are in the default branch & commits in stable are in beta + the default
3+
# branch.
34
set -euo pipefail
45
IFS=$'\n\t'
56

@@ -19,11 +20,11 @@ verify_backported_commits_main() {
1920
fi
2021

2122
if [[ $ci_base_branch == "beta" ]]; then
22-
verify_cherries master "$BETA_LIMIT" \
23+
verify_cherries HEAD "$BETA_LIMIT" \
2324
|| exit 1
2425

2526
elif [[ $ci_base_branch == "stable" ]]; then
26-
(verify_cherries master "$STABLE_LIMIT" \
27+
(verify_cherries HEAD "$STABLE_LIMIT" \
2728
& verify_cherries beta "$STABLE_LIMIT") \
2829
|| exit 1
2930

@@ -64,7 +65,7 @@ verify_cherries() {
6465
continue
6566
fi
6667

67-
if ! is_in_master "$backport_sha"; then
68+
if ! is_in_default_branch "$backport_sha"; then
6869
bad_backports+=("$sha")
6970
continue
7071
fi
@@ -85,7 +86,7 @@ verify_cherries() {
8586
done
8687
echo
8788
echo "do not match any commits in \`$1\`. If this was intended, add the text"
88-
echo '\`backport-of: <SHA of a commit already in master>\`'
89+
echo '\`backport-of: <SHA of a commit already in the default branch>\`'
8990
echo 'somewhere in the message of each of these commits.'
9091
echo
9192
failure=1
@@ -101,7 +102,7 @@ verify_cherries() {
101102
done
102103
echo
103104
echo 'have commit messages marked \`backport-of: <SHA>\`, but the SHA is not in'
104-
echo '\`master\`.'
105+
echo 'the default branch.'
105106
echo
106107
failure=1
107108
fi
@@ -132,11 +133,11 @@ get_backport() {
132133
| sed -n '/^.*backport-of:\s\?\([a-f0-9]\+\|nothing\).*/{s//\1/p;q}'
133134
}
134135

135-
# Check if a commit is in master.
136+
# Check if a commit is in the default branch.
136137
#
137138
# $1 = <sha>
138-
is_in_master() {
139-
git merge-base --is-ancestor "$1" origin/master 2> /dev/null
139+
is_in_default_branch() {
140+
git merge-base --is-ancestor "$1" origin/HEAD 2> /dev/null
140141
}
141142

142143
verify_backported_commits_main

0 commit comments

Comments
 (0)