Skip to content

Commit 26f2cf1

Browse files
committed
Resolve default branch name in run.sh
1 parent 2647669 commit 26f2cf1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

local/run.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set -euo pipefail
77
IFS=$'\n\t'
88

99
RUSTC_REPO="https://github.com/rust-lang/rust"
10-
RUSTC_DEFAULT_BRANCH="master"
1110

1211
# CDN to download CI artifacts from.
1312
DOWNLOAD_BASE="https://ci-artifacts.rust-lang.org/rustc-builds"
@@ -47,17 +46,17 @@ override_commit="$2"
4746

4847
# Nightly is on the default branch
4948
if [[ "${channel}" = "nightly" ]]; then
50-
branch="${RUSTC_DEFAULT_BRANCH}"
49+
branch="HEAD"
5150
else
52-
branch="${channel}"
51+
branch="refs/heads/${channel}"
5352
fi
5453

5554
echo "==> overriding files to force promote-release to run"
5655
mc cp "/src/local/channel-rust-${channel}.toml" "local/static/dist/channel-rust-${channel}.toml" >/dev/null
5756

5857
if [[ "${override_commit}" = "" ]]; then
5958
echo "==> detecting the last rustc commit on branch ${branch}"
60-
commit="$(git ls-remote "${RUSTC_REPO}" | grep "refs/heads/${branch}" | awk '{print($1)}')"
59+
commit="$(git ls-remote "${RUSTC_REPO}" "${branch}" | awk '{print($1)}')"
6160
else
6261
echo "=>> using overridden commit ${override_commit}"
6362
commit="${override_commit}"

0 commit comments

Comments
 (0)