Skip to content

Commit 30be8b5

Browse files
Merge branch 'next' of github.com:so-fancy/diff-so-fancy into next
2 parents 800cf91 + fc55bc8 commit 30be8b5

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

diff-so-fancy

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -444,30 +444,19 @@ sub boolean {
444444
}
445445
}
446446

447-
# Memoize getting the git config
447+
# Get the git config
448448
sub git_config_raw {
449-
state $static_config;
450-
451-
if ($static_config) {
452-
# If we already have the config return that
453-
return $static_config;
454-
}
455-
456449
my $cmd = "git config --list";
457450
my @out = `$cmd`;
458451

459-
$static_config = \@out;
460-
461452
return \@out;
462453
}
463454

464-
# Fetch a textual item from the git config
455+
# Memoize fetching a textual item from the git config
465456
sub git_config {
466457
my $search_key = lc($_[0] || "");
467458
my $default_value = lc($_[1] || "");
468459

469-
my $out = git_config_raw();
470-
471460
# If we're in a unit test, use the default (don't read the users config)
472461
if (in_unit_test()) {
473462
return $default_value;
@@ -482,6 +471,8 @@ sub git_config {
482471
print "Parsing git config\n";
483472
}
484473

474+
my $out = git_config_raw();
475+
485476
foreach my $line (@$out) {
486477
if ($line =~ /=/) {
487478
my ($key,$value) = split("=",$line,2);

0 commit comments

Comments
 (0)