From 6bad8a27f70b68699c9deeb1d567d60cc12fcedb Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 11 Apr 2024 17:45:11 +0100 Subject: [PATCH] refactor: reuse branch::reset to advance main branch to next --- src/server/actors/repo/branch.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server/actors/repo/branch.rs b/src/server/actors/repo/branch.rs index 0b675b8a..c19cf437 100644 --- a/src/server/actors/repo/branch.rs +++ b/src/server/actors/repo/branch.rs @@ -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, ) { - 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") } }; }