diff --git a/cli/src/command_error.rs b/cli/src/command_error.rs index 665c9f522..56bedf7a6 100644 --- a/cli/src/command_error.rs +++ b/cli/src/command_error.rs @@ -508,7 +508,6 @@ impl From for CommandError { mod git { use jj_lib::git::GitExportError; use jj_lib::git::GitFetchError; - use jj_lib::git::GitFetchPrepareError; use jj_lib::git::GitImportError; use jj_lib::git::GitPushError; use jj_lib::git::GitRemoteManagementError; @@ -567,14 +566,6 @@ jj currently does not support partial clones. To use jj with this repository, tr } } - impl From for CommandError { - fn from(err: GitFetchPrepareError) -> Self { - match err { - GitFetchPrepareError::UnexpectedBackend(_) => user_error(err), - } - } - } - impl From for CommandError { fn from(err: GitPushError) -> Self { match err { diff --git a/lib/src/git.rs b/lib/src/git.rs index 997d59f1f..c79486038 100644 --- a/lib/src/git.rs +++ b/lib/src/git.rs @@ -2084,14 +2084,6 @@ pub enum GitFetchError { Subprocess(#[from] GitSubprocessError), } -// TODO: If Git2 implementation is removed, this can be replaced with -// UnexpectedGitBackendError. -#[derive(Debug, Error)] -pub enum GitFetchPrepareError { - #[error(transparent)] - UnexpectedBackend(#[from] UnexpectedGitBackendError), -} - struct FetchedBranches { remote: RemoteNameBuf, branches: Vec, @@ -2109,7 +2101,7 @@ impl<'a> GitFetch<'a> { pub fn new( mut_repo: &'a mut MutableRepo, git_settings: &'a GitSettings, - ) -> Result { + ) -> Result { let fetch_impl = GitFetchImpl::new(mut_repo.store(), git_settings)?; Ok(GitFetch { mut_repo, @@ -2220,7 +2212,10 @@ enum GitFetchImpl<'a> { } impl<'a> GitFetchImpl<'a> { - fn new(store: &Store, git_settings: &'a GitSettings) -> Result { + fn new( + store: &Store, + git_settings: &'a GitSettings, + ) -> Result { let git_backend = get_git_backend(store)?; let git_repo = Box::new(git_backend.git_repo()); let git_ctx =