Unified · Split
| @@ -47,7 +47,7 @@ mod prefix { · 46 unmodified lines | ||
| 47 | 47 | #[error(transparent)] |
| 48 | 48 | FindExisting(#[from] crate::object::find::existing::OdbError), |
| 49 | 49 | #[error(transparent)] |
| 50 | − Config(#[from] git_config::parser::ParserOrIoError<'static>), | |
| 50 | + Config(#[from] crate::config::open::Error), | |
| 51 | 51 | #[error(transparent)] |
| 52 | 52 | Prefix(#[from] git_hash::prefix::Error), |
| 53 | 53 | } |
| @@ -228,6 +228,18 @@ pub fn open(directory: impl Into<std::path::PathBuf>) -> Result<crate::Repositor · 227 unmodified lines | ||
| 228 | 228 | /// |
| 229 | 229 | pub mod open; |
| 230 | 230 | |
| 231 | +/// | |
| 232 | +mod config { | |
| 233 | + /// | |
| 234 | + pub mod open { | |
| 235 | + pub type Error = git_config::parser::ParserOrIoError<'static>; | |
| 236 | + } | |
| 237 | + /// | |
| 238 | + pub mod query { | |
| 239 | + pub type Error = git_config::file::GitConfigError<'static>; | |
| 240 | + } | |
| 241 | +} | |
| 242 | + | |
| 231 | 243 | /// |
| 232 | 244 | pub mod init { |
| 233 | 245 | use std::{convert::TryInto, path::Path}; |
| @@ -31,7 +31,7 @@ impl Options { · 30 unmodified lines | ||
| 31 | 31 | #[allow(missing_docs)] |
| 32 | 32 | pub enum Error { |
| 33 | 33 | #[error(transparent)] |
| 34 | − Config(#[from] git_config::parser::ParserOrIoError<'static>), | |
| 34 | + Config(#[from] crate::config::open::Error), | |
| 35 | 35 | #[error(transparent)] |
| 36 | 36 | NotARepository(#[from] crate::path::is::Error), |
| 37 | 37 | #[error(transparent)] |
| @@ -0,0 +1,9 @@ | ||
| 1 | +use crate::config; | |
| 2 | + | |
| 3 | +/// Provide simplified access to git configuration values | |
| 4 | +impl crate::Repository { | |
| 5 | + /// Return the integer value at `key` (like `core.abbrev`) or use the given `default` value if it isn't present. | |
| 6 | + pub fn config_int(_key: &str, _default: i64) -> Result<i64, config::query::Error> { | |
| 7 | + todo!() | |
| 8 | + } | |
| 9 | +} | |
| @@ -82,6 +82,8 @@ mod trait_impls; · 81 unmodified lines | ||
| 82 | 82 | |
| 83 | 83 | mod cache; |
| 84 | 84 | |
| 85 | +mod config; | |
| 86 | + | |
| 85 | 87 | mod reference; |
| 86 | 88 | |
| 87 | 89 | mod object; |