forked from kemitix/git-next
refactor: reuse branch::reset to advance main branch to next
This commit is contained in:
parent
ab58981f87
commit
6bad8a27f7
1 changed files with 5 additions and 6 deletions
|
@ -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")
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue