pub struct GitBridge<'a> { /* private fields */ }Expand description
Git bridge for Heddle repository.
Implementations§
Source§impl<'a> GitBridge<'a>
impl<'a> GitBridge<'a>
Sourcepub fn new(heddle_repo: &'a HeddleRepository) -> Self
pub fn new(heddle_repo: &'a HeddleRepository) -> Self
Create a new Git bridge for a Heddle repository.
Sourcepub fn init_mirror(&mut self) -> GitResult<()>
pub fn init_mirror(&mut self) -> GitResult<()>
Initialize a Git mirror in the .heddle/git directory.
Sourcepub fn mirror_path(&self) -> PathBuf
pub fn mirror_path(&self) -> PathBuf
Get the path to the Git mirror directory.
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if a Git mirror is initialized.
Sourcepub fn export(&mut self) -> GitResult<ExportStats>
pub fn export(&mut self) -> GitResult<ExportStats>
Export all Heddle states to Git commits.
Sourcepub fn import(&mut self, git_path: Option<&Path>) -> GitResult<ImportStats>
pub fn import(&mut self, git_path: Option<&Path>) -> GitResult<ImportStats>
Import Git commits into Heddle states.
Sourcepub fn export_to_path(&mut self, target_path: &Path) -> GitResult<ExportStats>
pub fn export_to_path(&mut self, target_path: &Path) -> GitResult<ExportStats>
Export current Heddle state into the internal mirror, then write it out
as a bare git repository at target_path. Auto-initializes
target_path as a bare repo if it does not already exist.
Sourcepub fn fetch(&mut self, remote_name: &str) -> GitResult<()>
pub fn fetch(&mut self, remote_name: &str) -> GitResult<()>
Fetch Git refs and objects into the internal mirror without moving Heddle thread refs or the current worktree.
Sourcepub fn write_through_current_checkout(
&mut self,
) -> GitResult<WriteThroughOutcome>
pub fn write_through_current_checkout( &mut self, ) -> GitResult<WriteThroughOutcome>
Make the checkout’s real .git view agree with the current Heddle
thread: copy exported objects from the internal mirror, advance the
matching Git branch, attach HEAD, and rebuild the Git index from the
exported commit tree.
Auto Trait Implementations§
impl<'a> Freeze for GitBridge<'a>
impl<'a> !RefUnwindSafe for GitBridge<'a>
impl<'a> Send for GitBridge<'a>
impl<'a> Sync for GitBridge<'a>
impl<'a> Unpin for GitBridge<'a>
impl<'a> UnsafeUnpin for GitBridge<'a>
impl<'a> !UnwindSafe for GitBridge<'a>
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request