Skip to content

Commit

Permalink
Update the "binary"
Browse files Browse the repository at this point in the history
  • Loading branch information
scottchiefbaker committed Jul 19, 2017
1 parent 3840295 commit a7f8ccd
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions third_party/build_fatpack/diff-so-fancy
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ unshift @INC, bless \%fatpacked, $class;
} # END OF FATPACK CODE


my $VERSION = "1.1.0";
my $VERSION = "1.1.1";

#################################################################################

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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

0 comments on commit a7f8ccd

Please sign in to comment.