diff options
author | ryuta69 <eyma22s.yu@gmail.com> | 2020-09-19 00:00:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-18 11:00:52 -0400 |
commit | 3b5c89fcbc6efc2a346dfbd2cc2c49fcdae8a0b0 (patch) | |
tree | 24f15c8cfec6cb50d3879e923fb311dac09bcfb4 /src/options | |
parent | dd88342018aa239c77d7667bc988f0ff5db4610a (diff) |
Fix `git add -p` to work when any options enabled (#323)
* Add test for input and output for diff interactive filter
* Add color_only in config struct
* Refactor should_handle false when color_only and FileMeta, CommitMeta
* Refactor handle_hunk_header_line to show raw_text with color_format when color_only
* Fix indent
* Revert the logic changes for interactive filter
* Add color only workaround in set options
* Add more test patterns for diff interactive fillter
Diffstat (limited to 'src/options')
-rw-r--r-- | src/options/set.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/options/set.rs b/src/options/set.rs index a6b4f151..a9ca6be7 100644 --- a/src/options/set.rs +++ b/src/options/set.rs @@ -19,8 +19,8 @@ use crate::options::option_value::{OptionValue, ProvenancedOptionValue}; use crate::options::{self, theme}; macro_rules! set_options { - ([$( $field_ident:ident ),* ], - $opt:expr, $builtin_features:expr, $git_config:expr, $arg_matches:expr, $expected_option_name_map:expr, $check_names:expr) => { + ([$( $field_ident:ident ),* ], + $opt:expr, $builtin_features:expr, $git_config:expr, $arg_matches:expr, $expected_option_name_map:expr, $check_names:expr) => { let mut option_names = HashSet::new(); $( let kebab_case_field_name = stringify!($field_ident).replace("_", "-"); @@ -59,7 +59,7 @@ macro_rules! set_options { &option_names - &expected_option_names)); } } - } + } } pub fn set_options( @@ -192,6 +192,10 @@ pub fn set_options( // there (does not emit lines in 1-1 correspondence with raw git output). See #274. if opt.color_only { opt.side_by_side = false; + opt.file_style = "raw".to_string(); + opt.commit_style = "raw".to_string(); + opt.hunk_header_style = "raw".to_string(); + opt.hunk_header_decoration_style = "none".to_string(); } } |