File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
# !/usr/bin/env perl
2
2
3
- my $VERSION = " 1.1.0 " ;
3
+ my $VERSION = " 1.1.1 " ;
4
4
5
5
# ################################################################################
6
6
@@ -367,13 +367,17 @@ sub get_git_config_hash {
367
367
my %hash ;
368
368
foreach my $line (@$out ) {
369
369
my ($key ,$value ) = split (" =" ,$line ,2);
370
- $value =~ s /\s +$// ;
371
- my @path = split (/ \. / ,$key );
372
370
373
- my $last = pop @path ;
374
- my $p = \%hash ;
375
- $p = $p -> {$_ } ||= {} for @path ;
376
- $p -> {$last } = $value ;
371
+ if ($key && $value ) {
372
+ $value =~ s /\s +$// ;
373
+ my @path = split (/ \. / ,$key );
374
+ my $last = pop @path ;
375
+ my $p = \%hash ;
376
+
377
+ # Build the tree for each section
378
+ $p = $p -> {$_ } ||= {} for @path ;
379
+ $p -> {$last } = $value ;
380
+ }
377
381
}
378
382
379
383
return \%hash ;
@@ -612,13 +616,12 @@ sub is_windows {
612
616
613
617
# Return value is whether this is the first time they've run d-s-f
614
618
sub check_first_run {
615
- my $i = get_git_config_hash();
616
619
my $ret = 0;
617
620
618
621
# If first-run is not set, or it's set to "true"
619
- my $first_run = boolean(! $i -> { ' diff-so-fancy' } -> { ' first-run' } || ( $i -> { ' diff-so-fancy ' } -> { ' first-run ' } eq " true " ) );
622
+ my $first_run = git_config_boolean( ' diff-so-fancy. first-run' );
620
623
# See if they're previously set SOME diff-highlight colors
621
- my $has_dh_colors = boolean( $i -> { color } -> { ' diff-highlight' } -> { oldnormal } || $i -> { color } -> { ' diff-highlight' } -> { newnormal } );
624
+ my $has_dh_colors = git_config_boolean( ' color. diff-highlight. oldnormal' ) || git_config_boolean( ' color. diff-highlight. newnormal' );
622
625
623
626
if (!$first_run || $has_dh_colors ) {
624
627
return 0;
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ set_env() {
13
13
14
14
# applying colors so ANSI color values will match
15
15
# FIXME: not everyone will have these set, so we need to test for that.
16
- git config color.diff.meta " yellow bold"
17
- git config color.diff.commit " green bold"
16
+ git config color.diff.meta " 227"
18
17
git config color.diff.frag " magenta bold"
18
+ git config color.diff.commit " 227 bold"
19
19
git config color.diff.old " red bold"
20
20
git config color.diff.new " green bold"
21
21
git config color.diff.whitespace " red reverse"
You can’t perform that action at this time.
0 commit comments