refactor: reuse branch::reset to advance main branch to next
All checks were successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful

This commit is contained in:
Paul Campbell 2024-04-11 17:45:11 +01:00
parent ab58981f87
commit 6bad8a27f7

View file

@ -166,26 +166,25 @@ fn find_next_commit_on_dev(
}
// advance main branch to the commit 'next'
#[tracing::instrument(fields(next))]
pub async fn advance_main(
next: forge::Commit,
repo_details: config::RepoDetails,
repo_config: config::RepoConfig,
addr: Addr<RepoActor>,
) {
info!("Advance Main");
let result = reset(
match reset(
&repo_config.branches().main(),
next,
ResetForce::Normal,
&repo_details,
);
match result {
) {
Ok(_) => {
info!("Advance Next Success");
info!("Success");
addr.do_send(StartRepo);
}
Err(err) => {
warn!(?err, "Advance Next Failed")
warn!(?err, "Failed")
}
};
}