feat(JjLib): JjLib implementation

This commit is contained in:
2026-02-09 20:55:40 +01:00
parent e9142237a3
commit bd20747bae
5 changed files with 713 additions and 26 deletions

View File

@@ -16,6 +16,10 @@ pub enum Error {
JjOperation { context: String },
#[error("Repository is locked by another process")]
RepositoryLocked,
#[error("Could not get current directory")]
FailedGettingCurrentDir,
#[error("Could not load Jujutsu configuration")]
FailedReadingConfig,
// Application errors
#[error("Operation cancelled by user")]
Cancelled,
@@ -40,3 +44,15 @@ impl From<CommitMessageError> for Error {
Self::InvalidCommitMessage(value.to_string())
}
}
impl From<std::io::Error> for Error {
fn from(_value: std::io::Error) -> Self {
Self::FailedGettingCurrentDir
}
}
impl From<jj_lib::config::ConfigGetError> for Error {
fn from(_: jj_lib::config::ConfigGetError) -> Self {
Self::FailedReadingConfig
}
}