@@ -289,7 +289,7 @@ unshift @INC, bless \%fatpacked, $class;
289
289
} # END OF FATPACK CODE
290
290
291
291
292
- my $VERSION = " 1.1.0 " ;
292
+ my $VERSION = " 1.1.1 " ;
293
293
294
294
# ################################################################################
295
295
@@ -656,13 +656,17 @@ sub get_git_config_hash {
656
656
my %hash ;
657
657
foreach my $line (@$out ) {
658
658
my ($key ,$value ) = split (" =" ,$line ,2);
659
- $value =~ s /\s +$// ;
660
- my @path = split (/ \. / ,$key );
661
659
662
- my $last = pop @path ;
663
- my $p = \%hash ;
664
- $p = $p -> {$_ } ||= {} for @path ;
665
- $p -> {$last } = $value ;
660
+ if ($key && $value ) {
661
+ $value =~ s /\s +$// ;
662
+ my @path = split (/ \. / ,$key );
663
+ my $last = pop @path ;
664
+ my $p = \%hash ;
665
+
666
+ # Build the tree for each section
667
+ $p = $p -> {$_ } ||= {} for @path ;
668
+ $p -> {$last } = $value ;
669
+ }
666
670
}
667
671
668
672
return \%hash ;
@@ -901,13 +905,12 @@ sub is_windows {
901
905
902
906
# Return value is whether this is the first time they've run d-s-f
903
907
sub check_first_run {
904
- my $i = get_git_config_hash();
905
908
my $ret = 0;
906
909
907
910
# If first-run is not set, or it's set to "true"
908
- my $first_run = boolean(! $i -> { ' diff-so-fancy' } -> { ' first-run' } || ( $i -> { ' diff-so-fancy ' } -> { ' first-run ' } eq " true " ) );
911
+ my $first_run = git_config_boolean( ' diff-so-fancy. first-run' );
909
912
# See if they're previously set SOME diff-highlight colors
910
- my $has_dh_colors = boolean( $i -> { color } -> { ' diff-highlight' } -> { oldnormal } || $i -> { color } -> { ' diff-highlight' } -> { newnormal } );
913
+ my $has_dh_colors = git_config_boolean( ' color. diff-highlight. oldnormal' ) || git_config_boolean( ' color. diff-highlight. newnormal' );
911
914
912
915
if (!$first_run || $has_dh_colors ) {
913
916
return 0;
@@ -922,7 +925,8 @@ sub check_first_run {
922
925
my $reset = color(" reset" );
923
926
924
927
printf (" \n %s%s%sWarning :%s This appears to be the first time you've run diff-so-fancy. Please note that the\n " ,$blink ,$bold ,$warn ,$reset );
925
- printf (" default colors may not be optimal. Please run 'diff-so-fancy --colors' to see our color recommendations.\n\n " );
928
+ printf (" default colors may not be optimal. Please run 'diff-so-fancy --colors' to see our color recommendations.\n " );
929
+ printf (" To silence this error run: 'git config --global diff-so-fancy.first-run false'.\n\n " );
926
930
927
931
return 0;
928
932
}
@@ -1003,4 +1007,4 @@ sub color {
1003
1007
return $ret ;
1004
1008
}
1005
1009
1006
- # vim: tabstop=4 shiftwidth=4 autoindent softtabstop=4
1010
+ # vim: tabstop=4 shiftwidth=4 noexpandtab autoindent softtabstop=4
0 commit comments