diff options
-rw-r--r-- | src/cli.rs | 4 | ||||
-rw-r--r-- | src/config.rs | 4 |
2 files changed, 7 insertions, 1 deletions
@@ -630,6 +630,9 @@ pub struct Opt { pub computed: ComputedValues, #[structopt(skip)] + pub git_config: Option<GitConfig>, + + #[structopt(skip)] pub git_config_entries: HashMap<String, GitConfigEntry>, } @@ -701,6 +704,7 @@ impl Opt { let mut opt = Opt::from_clap(&arg_matches); options::rewrite::apply_rewrite_rules(&mut opt, &arg_matches); options::set::set_options(&mut opt, &mut git_config, &arg_matches, assets); + opt.git_config = git_config; opt } diff --git a/src/config.rs b/src/config.rs index 1972fa47..b0a8cb3c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -15,7 +15,7 @@ use crate::delta::State; use crate::env; use crate::features::navigate; use crate::features::side_by_side; -use crate::git_config::GitConfigEntry; +use crate::git_config::{GitConfig, GitConfigEntry}; use crate::style::{self, Style}; pub struct Config { @@ -35,6 +35,7 @@ pub struct Config { pub file_renamed_label: String, pub hunk_label: String, pub file_style: Style, + pub git_config: Option<GitConfig>, pub git_config_entries: HashMap<String, GitConfigEntry>, pub hunk_header_file_style: Style, pub hunk_header_line_number_style: Style, @@ -213,6 +214,7 @@ impl From<cli::Opt> for Config { file_renamed_label, hunk_label, file_style, + git_config: opt.git_config, git_config_entries: opt.git_config_entries, hunk_header_file_style, hunk_header_line_number_style, |