git: remove GitFetchPrepareError

This commit is contained in:
Emily 2025-03-15 04:36:05 +00:00
parent 1f1440d334
commit 860a787958
2 changed files with 5 additions and 19 deletions

View file

@ -508,7 +508,6 @@ impl From<TrailerParseError> 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<GitFetchPrepareError> for CommandError {
fn from(err: GitFetchPrepareError) -> Self {
match err {
GitFetchPrepareError::UnexpectedBackend(_) => user_error(err),
}
}
}
impl From<GitPushError> for CommandError {
fn from(err: GitPushError) -> Self {
match err {

View file

@ -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<StringPattern>,
@ -2109,7 +2101,7 @@ impl<'a> GitFetch<'a> {
pub fn new(
mut_repo: &'a mut MutableRepo,
git_settings: &'a GitSettings,
) -> Result<Self, GitFetchPrepareError> {
) -> Result<Self, UnexpectedGitBackendError> {
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<Self, GitFetchPrepareError> {
fn new(
store: &Store,
git_settings: &'a GitSettings,
) -> Result<Self, UnexpectedGitBackendError> {
let git_backend = get_git_backend(store)?;
let git_repo = Box::new(git_backend.git_repo());
let git_ctx =