Skip to content

Commit a7f8ccd

Browse files
Update the "binary"
1 parent 3840295 commit a7f8ccd

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

third_party/build_fatpack/diff-so-fancy

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ unshift @INC, bless \%fatpacked, $class;
289289
} # END OF FATPACK CODE
290290

291291

292-
my $VERSION = "1.1.0";
292+
my $VERSION = "1.1.1";
293293

294294
#################################################################################
295295

@@ -656,13 +656,17 @@ sub get_git_config_hash {
656656
my %hash;
657657
foreach my $line (@$out) {
658658
my ($key,$value) = split("=",$line,2);
659-
$value =~ s/\s+$//;
660-
my @path = split(/\./,$key);
661659

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+
}
666670
}
667671

668672
return \%hash;
@@ -901,13 +905,12 @@ sub is_windows {
901905

902906
# Return value is whether this is the first time they've run d-s-f
903907
sub check_first_run {
904-
my $i = get_git_config_hash();
905908
my $ret = 0;
906909

907910
# 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');
909912
# 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');
911914

912915
if (!$first_run || $has_dh_colors) {
913916
return 0;
@@ -922,7 +925,8 @@ sub check_first_run {
922925
my $reset = color("reset");
923926

924927
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");
926930

927931
return 0;
928932
}
@@ -1003,4 +1007,4 @@ sub color {
10031007
return $ret;
10041008
}
10051009

1006-
# vim: tabstop=4 shiftwidth=4 autoindent softtabstop=4
1010+
# vim: tabstop=4 shiftwidth=4 noexpandtab autoindent softtabstop=4

0 commit comments

Comments
 (0)