pub struct BranchManager { /* private fields */ }
Expand description
Manages branch operations and metadata
Implementations§
Source§impl BranchManager
impl BranchManager
Sourcepub fn new(git_repo: GitRepository) -> Self
pub fn new(git_repo: GitRepository) -> Self
Create a new BranchManager
Sourcepub fn get_branch_info(&self) -> Result<Vec<BranchInfo>>
pub fn get_branch_info(&self) -> Result<Vec<BranchInfo>>
Get information about all branches
Sourcepub fn generate_branch_name(&self, message: &str) -> String
pub fn generate_branch_name(&self, message: &str) -> String
Generate a safe branch name from a commit message
Sourcepub fn create_branch_from_message(
&self,
message: &str,
target: Option<&str>,
) -> Result<String>
pub fn create_branch_from_message( &self, message: &str, target: Option<&str>, ) -> Result<String>
Create a new branch with a generated name
Sourcepub fn set_upstream(
&self,
branch_name: &str,
remote: &str,
remote_branch: &str,
) -> Result<()>
pub fn set_upstream( &self, branch_name: &str, remote: &str, remote_branch: &str, ) -> Result<()>
Set upstream tracking for a branch
Sourcepub fn get_branch_upstream(
&self,
branch_name: &str,
) -> Result<Option<UpstreamInfo>>
pub fn get_branch_upstream( &self, branch_name: &str, ) -> Result<Option<UpstreamInfo>>
Get upstream info for a specific branch
Sourcepub fn has_upstream(&self, branch_name: &str) -> Result<bool>
pub fn has_upstream(&self, branch_name: &str) -> Result<bool>
Check if a branch has upstream tracking
Sourcepub fn git_repo(&self) -> &GitRepository
pub fn git_repo(&self) -> &GitRepository
Get the underlying Git repository
Auto Trait Implementations§
impl Freeze for BranchManager
impl RefUnwindSafe for BranchManager
impl Send for BranchManager
impl !Sync for BranchManager
impl Unpin for BranchManager
impl UnwindSafe for BranchManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more