diff --git a/third_party/build_fatpack/diff-so-fancy b/third_party/build_fatpack/diff-so-fancy index 232c547..72a3a72 100755 --- a/third_party/build_fatpack/diff-so-fancy +++ b/third_party/build_fatpack/diff-so-fancy @@ -289,7 +289,7 @@ unshift @INC, bless \%fatpacked, $class; } # END OF FATPACK CODE -my $VERSION = "1.1.0"; +my $VERSION = "1.1.1"; ################################################################################# @@ -656,13 +656,17 @@ sub get_git_config_hash { my %hash; foreach my $line (@$out) { my ($key,$value) = split("=",$line,2); - $value =~ s/\s+$//; - my @path = split(/\./,$key); - my $last = pop @path; - my $p = \%hash; - $p = $p->{$_} ||= {} for @path; - $p->{$last} = $value; + if ($key && $value) { + $value =~ s/\s+$//; + my @path = split(/\./,$key); + my $last = pop @path; + my $p = \%hash; + + # Build the tree for each section + $p = $p->{$_} ||= {} for @path; + $p->{$last} = $value; + } } return \%hash; @@ -901,13 +905,12 @@ sub is_windows { # Return value is whether this is the first time they've run d-s-f sub check_first_run { - my $i = get_git_config_hash(); my $ret = 0; # If first-run is not set, or it's set to "true" - my $first_run = boolean(!$i->{'diff-so-fancy'}->{'first-run'} || ($i->{'diff-so-fancy'}->{'first-run'} eq "true")); + my $first_run = git_config_boolean('diff-so-fancy.first-run'); # See if they're previously set SOME diff-highlight colors - my $has_dh_colors = boolean($i->{color}->{'diff-highlight'}->{oldnormal} || $i->{color}->{'diff-highlight'}->{newnormal}); + my $has_dh_colors = git_config_boolean('color.diff-highlight.oldnormal') || git_config_boolean('color.diff-highlight.newnormal'); if (!$first_run || $has_dh_colors) { return 0; @@ -922,7 +925,8 @@ sub check_first_run { my $reset = color("reset"); 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); - printf("default colors may not be optimal. Please run 'diff-so-fancy --colors' to see our color recommendations.\n\n"); + printf("default colors may not be optimal. Please run 'diff-so-fancy --colors' to see our color recommendations.\n"); + printf("To silence this error run: 'git config --global diff-so-fancy.first-run false'.\n\n"); return 0; } @@ -1003,4 +1007,4 @@ sub color { return $ret; } -# vim: tabstop=4 shiftwidth=4 autoindent softtabstop=4 +# vim: tabstop=4 shiftwidth=4 noexpandtab autoindent softtabstop=4