This should stop most mistakes right away, instead of possibly silently ignoring them depending on what was hard-coded in the respective sub-command.
Unified · Split
| @@ -83,8 +83,15 @@ pub fn main() -> Result<()> { · 82 unmodified lines | |||
| 83 | 83 | ||
| 84 | let repository = { | 84 | let repository = { |
| 85 | let config = config.clone(); | 85 | let config = config.clone(); |
| 86 | move |mode: Mode| -> Result<gix::Repository> { | 86 | move |mut mode: Mode| -> Result<gix::Repository> { |
| 87 | let mut mapping: gix::sec::trust::Mapping<gix::open::Options> = Default::default(); | 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 | let strict_toggle = matches!(mode, Mode::Strict | Mode::StrictWithGitInstallConfig) || args.strict; | 95 | let strict_toggle = matches!(mode, Mode::Strict | Mode::StrictWithGitInstallConfig) || args.strict; |
| 89 | mapping.full = mapping.full.strict_config(strict_toggle); | 96 | mapping.full = mapping.full.strict_config(strict_toggle); |
| 90 | mapping.reduced = mapping.reduced.strict_config(strict_toggle); | 97 | mapping.reduced = mapping.reduced.strict_config(strict_toggle); |