Skip to content

Commit 883b5ed

Browse files
committed
Get version from user-provided commit
1 parent a947033 commit 883b5ed

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/rustup.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ impl Context {
3636
// Rustup only has beta and stable releases, so we fail fast when trying to promote nightly
3737
self.enforce_rustup_channel()?;
3838

39-
// The latest commit on the `stable` branch is used to determine the version number
40-
let head_sha = self.get_head_sha_for_rustup()?;
39+
// Get the latest commit from the `stable` branch or use the user-provided override
40+
let head_sha = self.get_commit_sha_for_rustup_release()?;
41+
42+
// The commit on the `stable` branch is used to determine the version number
4143
let version = self.get_next_rustup_version(&head_sha)?;
4244

4345
// Download the Rustup artifacts from S3
@@ -69,6 +71,13 @@ impl Context {
6971
Ok(())
7072
}
7173

74+
fn get_commit_sha_for_rustup_release(&self) -> anyhow::Result<String> {
75+
match &self.config.override_commit {
76+
Some(sha) => Ok(sha.clone()),
77+
None => self.get_head_sha_for_rustup(),
78+
}
79+
}
80+
7281
fn get_head_sha_for_rustup(&self) -> anyhow::Result<String> {
7382
self.config
7483
.github()

0 commit comments

Comments
 (0)