File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ git_index_line_pattern="^($color_code_regex)index .*"
38
38
39
39
format_diff_header () {
40
40
# simplify the unified patch diff header
41
- $SED -E " /^($color_code_regex )diff --git .*$/d " \
41
+ $SED -E " s /^($color_code_regex )diff --git .*$//g " \
42
42
| $SED -E " /$git_index_line_pattern /{N;s/$git_index_line_pattern \n//;}" \
43
43
| $SED -E " s/^($color_code_regex )\-\-\-(.*)$/\1$( print_horizontal_rule) \\ ${NL} \1\-\-\-\-\5/g" \
44
44
| $SED -E " s/^($color_code_regex )\+\+\+(.*)$/\1\+\+\+\+\5\\ ${NL} \1$( print_horizontal_rule) /g"
@@ -53,6 +53,10 @@ mark_empty_lines () {
53
53
$SED -E " s/^$color_code_regex [\+\-]$reset_color \s*$/$invert_color \1 $reset_escape /g"
54
54
}
55
55
56
+ remove_first_empty_line () {
57
+ $SED -E ' 1 D'
58
+ }
59
+
56
60
strip_leading_symbols () {
57
61
# strip the + and -
58
62
$SED -E " s/^($color_code_regex )[\+\-]/\1 /g"
@@ -73,5 +77,6 @@ cat $input \
73
77
| format_diff_header \
74
78
| colorize_context_line \
75
79
| mark_empty_lines \
80
+ | remove_first_empty_line \
76
81
| strip_leading_symbols \
77
82
| strip_first_column
You can’t perform that action at this time.
0 commit comments