#[non_exhaustive]pub enum RepositoryError {
Show 17 variants
NotARepository(NotARepositoryReason),
ForbiddenBareRepository {
path: String,
},
DubiousOwnership {
path: String,
owner_uid: Option<u32>,
effective_uid: Option<u32>,
},
UnsupportedRepositoryFormatVersion {
version: u32,
},
InvalidRefStorageFormat {
value: String,
},
InitObjectFormatChange,
InitBareWithSeparateGitDir,
InitRefStorageWithInjectedRefStore {
requested: RefStorageFormat,
},
RequiresWorkTree,
PromisorFetcherMissing,
UnknownRepositoryExtensions(UnknownRepositoryExtensions),
V1OnlyExtensionsInFormatZero(V1OnlyExtensionsInFormatZero),
GitDirPathIo(PathIoError),
UnsupportedObjectStore {
operation: FilesOnlyOperation,
},
PreciousObjectsRepository {
operation: &'static str,
},
ObjectFormatMismatch {
repository: HashAlgo,
store: HashAlgo,
},
MaintenanceRunning {
holder: GcLockHolder,
},
}Expand description
Failures opening, discovering, initializing, or validating a repository layout.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotARepository(NotARepositoryReason)
A repository could not be found or is structurally invalid.
ForbiddenBareRepository
A bare repository was found but access is forbidden by safe.bareRepository.
DubiousOwnership
The repository is owned by a different user (safe.directory).
Fields
UnsupportedRepositoryFormatVersion
Repository format version is not supported by this implementation.
InvalidRefStorageFormat
extensions.refStorage names an unsupported backend.
InitObjectFormatChange
super::Repository::init refused to change object format on reinit.
InitBareWithSeparateGitDir
super::Repository::init with incompatible --bare and separate git dir.
InitRefStorageWithInjectedRefStore
super::Repository::init was asked for an on-disk ref storage format while
RepositoryOptions::with_ref_store
injects the ref backend.
Fields
requested: RefStorageFormatThe ref storage format InitOptions::ref_storage requested.
RequiresWorkTree
Command requires a working tree but the repository is bare.
PromisorFetcherMissing
super::Repository::prefetch_promised was called without a promisor fetcher on the handle.
UnknownRepositoryExtensions(UnknownRepositoryExtensions)
Repository format version 1+ declares an extension this implementation does not recognize.
V1OnlyExtensionsInFormatZero(V1OnlyExtensionsInFormatZero)
Format version 0 declares an extension that requires format version 1 or newer.
GitDirPathIo(PathIoError)
Filesystem I/O failed on a path under the repository git directory.
UnsupportedObjectStore
The operation needs the files-backed objects/ directory, but the repository uses a custom primary store.
Fields
operation: FilesOnlyOperationThe operation that was refused.
PreciousObjectsRepository
The operation would delete objects, and extensions.preciousObjects forbids it.
ObjectFormatMismatch
Injected object store hash algorithm differs from the repository’s extensions.objectformat.
Fields
MaintenanceRunning
Another maintenance run holds the repository’s gc.pid lock
(crate::maintenance::GcLock); nothing was changed.
Fields
holder: GcLockHolderProcess recorded in gc.pid.
Implementations§
Source§impl RepositoryError
impl RepositoryError
Sourcepub fn kind_name(&self) -> &'static str
pub fn kind_name(&self) -> &'static str
Stable snake_case name (same slugs as the legacy umbrella variants for these failures).
Sourcepub fn area(&self) -> &'static str
pub fn area(&self) -> &'static str
Functional area for analytics and JSON (area), matching crate::error::Error::area when wrapped.
Sourcepub fn git_dir_path_io(
path: impl Into<String>,
operation: GitDirPathOperation,
source: Error,
) -> Self
pub fn git_dir_path_io( path: impl Into<String>, operation: GitDirPathOperation, source: Error, ) -> Self
Build Self::GitDirPathIo from git-dir path context (legacy call sites).
Trait Implementations§
Source§impl Debug for RepositoryError
impl Debug for RepositoryError
Source§impl Display for RepositoryError
impl Display for RepositoryError
Source§impl Error for RepositoryError
impl Error for RepositoryError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()