This should stop most mistakes right away, instead of possibly silently ignoring them depending on what was hard-coded in the respective sub-command.
Showing the changes to src (1 of 1 file). Show all
Unified · Split
| @@ -83,8 +83,15 @@ pub fn main() -> Result<()> { · 82 unmodified lines | ||
| 83 | 83 | |
| 84 | 84 | let repository = { |
| 85 | 85 | let config = config.clone(); |
| 86 | − move |mode: Mode| -> Result<gix::Repository> { | |
| 86 | + move |mut mode: Mode| -> Result<gix::Repository> { | |
| 87 | 87 | let mut mapping: gix::sec::trust::Mapping<gix::open::Options> = Default::default(); |
| 88 | + if !config.is_empty() { | |
| 89 | + mode = match mode { | |
| 90 | + Mode::Lenient => Mode::Strict, | |
| 91 | + Mode::LenientWithGitInstallConfig => Mode::StrictWithGitInstallConfig, | |
| 92 | + _ => mode, | |
| 93 | + }; | |
| 94 | + } | |
| 88 | 95 | let strict_toggle = matches!(mode, Mode::Strict | Mode::StrictWithGitInstallConfig) || args.strict; |
| 89 | 96 | mapping.full = mapping.full.strict_config(strict_toggle); |
| 90 | 97 | mapping.reduced = mapping.reduced.strict_config(strict_toggle); |