Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions collector/src/compile/execute/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ fn checkout(artifact: &ArtifactId) -> anyhow::Result<()> {
.current_dir("rust")
.arg("fetch")
.arg("origin")
.arg("master")
.arg("HEAD")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this update the reference that bootstrap is reading? My memory is hazy (and I'm not sure how to test) but I think I've seen git not update e.g. origin/master for this kind of command...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fetches and hard resets to a specific SHA anyway, so I think that it should be fine ( I don't know why we fetch HEAD at all).

.status()
.context("git fetch origin master")?;
.context("git fetch origin HEAD")?;
assert!(status.success(), "git fetch successful");
} else {
let status = Command::new("git")
Expand Down
6 changes: 6 additions & 0 deletions site/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,12 @@ pub mod github {
pub head_commit: HeadCommit,
pub before: String,
pub commits: Vec<Commit>,
pub repository: Repository,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Repository {
pub default_branch: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
4 changes: 3 additions & 1 deletion site/src/request_handlers/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ pub async fn handle_github(

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