Skip to content

Commit bb01a71

Browse files
Loop backwards over parents
1 parent 366a107 commit bb01a71

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

site/src/github.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,18 @@ async fn branch_for_rollup(
219219
.await
220220
.context("got rollup merge")?;
221221

222-
let old_master_commit =
223-
get_commit(&client, &data, repository_url, &rollup_merge.parents[0].sha)
222+
let mut current = rollup_merge.clone();
223+
loop {
224+
log::trace!("searching for auto branch, at {:?}", current.sha);
225+
if current.commit.message.starts_with("Auto merge") {
226+
break;
227+
}
228+
assert_eq!(current.parents.len(), 2);
229+
current = get_commit(&client, &data, repository_url, &current.parents[0].sha)
224230
.await
225231
.context("success master get")?;
232+
}
233+
let old_master_commit = current;
226234

227235
let current_master_commit = get_commit(&client, &data, repository_url, "master")
228236
.await

0 commit comments

Comments
 (0)