pub struct GitRepo { /* private fields */ }Expand description
Git repository wrapper for Beads operations.
Implementations§
Source§impl GitRepo
impl GitRepo
Sourcepub fn discover() -> Result<Self>
pub fn discover() -> Result<Self>
Discover and open the git repository from the current directory.
Sourcepub fn find_beads_dir(&self) -> Option<PathBuf>
pub fn find_beads_dir(&self) -> Option<PathBuf>
Find the .beads directory in the repository.
Sourcepub fn database_path(&self) -> Option<PathBuf>
pub fn database_path(&self) -> Option<PathBuf>
Get the database path.
Sourcepub fn jsonl_path(&self) -> Option<PathBuf>
pub fn jsonl_path(&self) -> Option<PathBuf>
Get the JSONL file path.
Sourcepub fn current_branch(&self) -> Result<String>
pub fn current_branch(&self) -> Result<String>
Get the current branch name.
Sourcepub fn has_beads_changes(&self) -> Result<bool>
pub fn has_beads_changes(&self) -> Result<bool>
Check if there are uncommitted changes in the .beads directory.
Sourcepub fn stage_beads_files(&self) -> Result<()>
pub fn stage_beads_files(&self) -> Result<()>
Stage files in the .beads directory.
Sourcepub fn commit(
&self,
message: &str,
author_name: &str,
author_email: &str,
) -> Result<Oid>
pub fn commit( &self, message: &str, author_name: &str, author_email: &str, ) -> Result<Oid>
Commit staged changes.
Sourcepub fn commit_beads_changes(&self, message: &str, actor: &str) -> Result<Oid>
pub fn commit_beads_changes(&self, message: &str, actor: &str) -> Result<Oid>
Commit changes with the default beads signature.
Sourcepub fn get_user_name(&self) -> Option<String>
pub fn get_user_name(&self) -> Option<String>
Get the user name from git config.
Sourcepub fn get_user_email(&self) -> Option<String>
pub fn get_user_email(&self) -> Option<String>
Get the user email from git config.
Auto Trait Implementations§
impl Freeze for GitRepo
impl RefUnwindSafe for GitRepo
impl Send for GitRepo
impl !Sync for GitRepo
impl Unpin for GitRepo
impl UnwindSafe for GitRepo
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