Skip to content

Commit 9184578

Browse files
authored
Merge pull request #2240 from Kobzol/remove-master-dependency
Stop hardcoding the master branch of rust-lang/rust
2 parents ea1a30f + 8da5ed6 commit 9184578

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

collector/src/compile/execute/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ fn checkout(artifact: &ArtifactId) -> anyhow::Result<()> {
193193
.current_dir("rust")
194194
.arg("fetch")
195195
.arg("origin")
196-
.arg("master")
196+
.arg("HEAD")
197197
.status()
198-
.context("git fetch origin master")?;
198+
.context("git fetch origin HEAD")?;
199199
assert!(status.success(), "git fetch successful");
200200
} else {
201201
let status = Command::new("git")

site/src/api.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,12 @@ pub mod github {
647647
pub head_commit: HeadCommit,
648648
pub before: String,
649649
pub commits: Vec<Commit>,
650+
pub repository: Repository,
651+
}
652+
653+
#[derive(Debug, Clone, Serialize, Deserialize)]
654+
pub struct Repository {
655+
pub default_branch: String,
650656
}
651657

652658
#[derive(Debug, Clone, Serialize, Deserialize)]

site/src/request_handlers/github.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ pub async fn handle_github(
2323

2424
async fn handle_push(ctxt: Arc<SiteCtxt>, push: github::Push) -> ServerResult<github::Response> {
2525
let gh_client = client::Client::from_ctxt(&ctxt, RUST_REPO_GITHUB_API_URL.to_owned());
26-
if push.r#ref != "refs/heads/master" || push.sender.login != "bors" {
26+
if push.r#ref != format!("refs/heads/{}", push.repository.default_branch)
27+
|| push.sender.login != "bors"
28+
{
2729
return Ok(github::Response);
2830
}
2931
let rollup_pr_number = match rollup_pr_number(&gh_client, &push.head_commit.message).await? {

0 commit comments

Comments
 (0)