Skip to content

Commit ef0952f

Browse files
vohoanglong0107Kobzol
authored andcommitted
test: remove unneeded test logic
1 parent 2366d03 commit ef0952f

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/bors/handlers/trybuild.rs

+2
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ mod tests {
427427
&[
428428
"ea9c1b050cc8b420c2c211d2177811e564a4dc60",
429429
&default_merge_sha(),
430+
"ea9c1b050cc8b420c2c211d2177811e564a4dc60",
431+
&default_merge_sha(),
430432
],
431433
);
432434
}

src/tests/state.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,7 @@ impl RepositoryClient for TestRepositoryClient {
359359
}
360360

361361
async fn set_branch_to_sha(&mut self, branch: &str, sha: &CommitSha) -> anyhow::Result<()> {
362-
let branch_history = self.branch_history.entry(branch.to_string()).or_default();
363-
let position = branch_history.iter().position(|s| s == sha);
364-
match position {
365-
None => branch_history.push(sha.clone()),
366-
Some(p) => {
367-
let (his, _) = branch_history.split_at(p + 1);
368-
let his = his.to_vec();
369-
self.branch_history.insert(branch.to_string(), his);
370-
}
371-
}
362+
self.add_branch_sha(branch, &sha.0);
372363
Ok(())
373364
}
374365

0 commit comments

Comments
 (0)