summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/options/set.rs1
-rw-r--r--src/tests/test_example_diffs.rs21
2 files changed, 20 insertions, 2 deletions
diff --git a/src/options/set.rs b/src/options/set.rs
index 449619fd..5b68ffec 100644
--- a/src/options/set.rs
+++ b/src/options/set.rs
@@ -197,7 +197,6 @@ pub fn set_options(
opt.side_by_side = false;
opt.file_decoration_style = "none".to_string();
opt.commit_decoration_style = "none".to_string();
- opt.commit_style = "raw".to_string();
opt.hunk_header_decoration_style = "none".to_string();
}
}
diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs
index c96a83e0..f4121588 100644
--- a/src/tests/test_example_diffs.rs
+++ b/src/tests/test_example_diffs.rs
@@ -989,7 +989,6 @@ src/align.rs
}
#[test]
- // TODO: commit-style is required to add.
fn test_hunk_header_style_with_color_only_has_style() {
let config = integration_test_utils::make_config_from_args(&[
"--color-only",
@@ -1010,6 +1009,26 @@ src/align.rs
}
#[test]
+ fn test_commit_style_with_color_only_has_style() {
+ let config = integration_test_utils::make_config_from_args(&[
+ "--color-only",
+ "--commit-style",
+ "red",
+ ]);
+ let output = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, &config);
+
+ ansi_test_utils::assert_line_has_style(
+ &output,
+ 0,
+ "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e",
+ "red",
+ &config,
+ );
+ let output = strip_ansi_codes(&output);
+ assert!(output.contains("commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e"));
+ }
+
+ #[test]
fn test_hunk_header_style_colored_input_color_is_stripped_under_normal() {
let config = integration_test_utils::make_config_from_args(&[
"--hunk-header-style",