From ec258bca97eb79b8720dfa7cd4b44feaa3e548eb Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 11 Apr 2024 18:09:57 +0100 Subject: [PATCH] refactor: rename ResetForce::Normal as None --- src/server/actors/repo/branch.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/actors/repo/branch.rs b/src/server/actors/repo/branch.rs index 259f4bd..ac2be6e 100644 --- a/src/server/actors/repo/branch.rs +++ b/src/server/actors/repo/branch.rs @@ -124,7 +124,7 @@ pub async fn advance_next( match reset( &repo_config.branches().next(), commit, - ResetForce::Normal, + ResetForce::None, &repo_details, ) { Ok(_) => { @@ -162,7 +162,7 @@ pub async fn advance_main( match reset( &repo_config.branches().main(), next, - ResetForce::Normal, + ResetForce::None, &repo_details, ) { Ok(_) => { @@ -194,8 +194,7 @@ impl Display for GitRef { } pub enum ResetForce { - #[allow(dead_code)] - Normal, + None, Force(GitRef), } pub fn reset( @@ -211,7 +210,7 @@ pub fn reset( let path = &repo_details.repo; let origin = format!("https://{user}:{token}@{hostname}/{path}.git"); let force = match reset_force { - ResetForce::Normal => "".to_string(), + ResetForce::None => "".to_string(), ResetForce::Force(old_ref) => format!("--force-with-lease={branch}:{old_ref}"), }; let command = format!("/usr/bin/git push {origin} {gitref}:{branch} {force}");