pub struct GitFetch<'a> { /* private fields */ }
Expand description
Helper struct to execute multiple git fetch
operations
Implementations§
Source§impl<'a> GitFetch<'a>
impl<'a> GitFetch<'a>
pub fn new( mut_repo: &'a mut MutableRepo, git_settings: &'a GitSettings, ) -> Result<Self, UnexpectedGitBackendError>
Sourcepub fn fetch(
&mut self,
remote_name: &RemoteName,
branch_names: &[StringPattern],
callbacks: RemoteCallbacks<'_>,
depth: Option<NonZeroU32>,
) -> Result<(), GitFetchError>
pub fn fetch( &mut self, remote_name: &RemoteName, branch_names: &[StringPattern], callbacks: RemoteCallbacks<'_>, depth: Option<NonZeroU32>, ) -> Result<(), GitFetchError>
Perform a git fetch
on the local git repo, updating the
remote-tracking branches in the git repo.
Keeps track of the {branch_names, remote_name} pair the refs can be
subsequently imported into the jj
repo by calling import_refs()
.
Sourcepub fn get_default_branch(
&self,
remote_name: &RemoteName,
) -> Result<Option<RefNameBuf>, GitFetchError>
pub fn get_default_branch( &self, remote_name: &RemoteName, ) -> Result<Option<RefNameBuf>, GitFetchError>
Queries remote for the default branch name.
Sourcepub fn import_refs(&mut self) -> Result<GitImportStats, GitImportError>
pub fn import_refs(&mut self) -> Result<GitImportStats, GitImportError>
Import the previously fetched remote-tracking branches into the jj repo and update jj’s local branches. We also import local tags since remote tags should have been merged by Git.
Clears all yet-to-be-imported {branch_names, remote_name} pairs after
the import. If fetch()
has not been called since the last time
import_refs()
was called then this will be a no-op.
Auto Trait Implementations§
impl<'a> Freeze for GitFetch<'a>
impl<'a> !RefUnwindSafe for GitFetch<'a>
impl<'a> !Send for GitFetch<'a>
impl<'a> !Sync for GitFetch<'a>
impl<'a> Unpin for GitFetch<'a>
impl<'a> !UnwindSafe for GitFetch<'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
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