Struct jj_lib::git_backend::GitBackend
source · pub struct GitBackend { /* private fields */ }
Implementations§
source§impl GitBackend
impl GitBackend
pub fn name() -> &'static str
pub fn init_internal(store_path: &Path) -> Result<Self, GitBackendInitError>
pub fn init_external( store_path: &Path, git_repo_path: &Path ) -> Result<Self, GitBackendInitError>
pub fn load(store_path: &Path) -> Result<Self, GitBackendLoadError>
sourcepub fn open_git_repo(&self) -> Result<Repository, Error>
pub fn open_git_repo(&self) -> Result<Repository, Error>
Creates new owned git repository instance.
sourcepub fn git_config(&self) -> Result<Config, Error>
pub fn git_config(&self) -> Result<Config, Error>
Git configuration for this repository.
sourcepub fn git_repo_path(&self) -> PathBuf
pub fn git_repo_path(&self) -> PathBuf
Path to the .git
directory or the repository itself if it’s bare.
sourcepub fn git_workdir(&self) -> Option<PathBuf>
pub fn git_workdir(&self) -> Option<PathBuf>
Path to the working directory if the repository isn’t bare.
sourcepub fn import_head_commits<'a>(
&self,
head_ids: impl IntoIterator<Item = &'a CommitId>,
uses_tree_conflict_format: bool
) -> BackendResult<()>
pub fn import_head_commits<'a>( &self, head_ids: impl IntoIterator<Item = &'a CommitId>, uses_tree_conflict_format: bool ) -> BackendResult<()>
Imports the given commits and ancestors from the backing Git repo.
Trait Implementations§
source§impl Backend for GitBackend
impl Backend for GitBackend
fn as_any(&self) -> &dyn Any
source§fn name(&self) -> &str
fn name(&self) -> &str
A unique name that identifies this backend. Written to
.jj/repo/store/backend
when the repo is created.source§fn commit_id_length(&self) -> usize
fn commit_id_length(&self) -> usize
The length of commit IDs in bytes.
source§fn change_id_length(&self) -> usize
fn change_id_length(&self) -> usize
The length of change IDs in bytes.
fn root_commit_id(&self) -> &CommitId
fn root_change_id(&self) -> &ChangeId
fn empty_tree_id(&self) -> &TreeId
fn read_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
id: &'life2 FileId
) -> Pin<Box<dyn Future<Output = BackendResult<Box<dyn Read>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_file( &self, _path: &RepoPath, contents: &mut dyn Read ) -> BackendResult<FileId>
fn read_symlink<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
id: &'life2 SymlinkId
) -> Pin<Box<dyn Future<Output = Result<String, BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_symlink( &self, _path: &RepoPath, target: &str ) -> Result<SymlinkId, BackendError>
fn read_tree<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
id: &'life2 TreeId
) -> Pin<Box<dyn Future<Output = BackendResult<Tree>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_tree(&self, _path: &RepoPath, contents: &Tree) -> BackendResult<TreeId>
fn read_conflict( &self, _path: &RepoPath, id: &ConflictId ) -> BackendResult<Conflict>
fn write_conflict( &self, _path: &RepoPath, conflict: &Conflict ) -> BackendResult<ConflictId>
fn read_commit<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CommitId
) -> Pin<Box<dyn Future<Output = BackendResult<Commit>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn write_commit(&self, contents: Commit) -> BackendResult<(CommitId, Commit)>
fn write_commit(&self, contents: Commit) -> BackendResult<(CommitId, Commit)>
Writes a commit and returns its ID and the commit itself. The commit
should contain the data that was actually written, which may differ
from the data passed in. For example, the backend may change the
committer name to an authenticated user’s name, or the backend’s
timestamps may have less precision than the millisecond precision in
Commit
.Auto Trait Implementations§
impl RefUnwindSafe for GitBackend
impl Send for GitBackend
impl Sync for GitBackend
impl Unpin for GitBackend
impl UnwindSafe for GitBackend
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