1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use crate::{parser, values::path::interpolate};
#[derive(Debug, thiserror::Error)]
#[allow(missing_docs)]
pub enum Error {
#[error(transparent)]
ParserOrIoError(#[from] parser::ParserOrIoError<'static>),
#[error(transparent)]
Interpolate(#[from] interpolate::Error),
#[error("The maximum allowed length {} of the file include chain built by following nested resolve_includes is exceeded", .max_depth)]
IncludeDepthExceeded { max_depth: u8 },
#[error("Include paths from environment variables must not be relative")]
MissingConfigPath,
}
#[derive(Clone, Copy)]
pub struct Options<'a> {
pub git_install_dir: Option<&'a std::path::Path>,
pub max_depth: u8,
pub error_on_max_depth_exceeded: bool,
pub git_dir: Option<&'a std::path::Path>,
pub branch_name: Option<&'a git_ref::FullNameRef>,
}
impl<'a> Default for Options<'a> {
fn default() -> Self {
Options {
git_install_dir: None,
max_depth: 10,
error_on_max_depth_exceeded: true,
git_dir: None,
branch_name: None,
}
}
}