File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -444,30 +444,19 @@ sub boolean {
444
444
}
445
445
}
446
446
447
- # Memoize getting the git config
447
+ # Get the git config
448
448
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
-
456
449
my $cmd = " git config --list" ;
457
450
my @out = ` $cmd ` ;
458
451
459
- $static_config = \@out ;
460
-
461
452
return \@out ;
462
453
}
463
454
464
- # Fetch a textual item from the git config
455
+ # Memoize fetching a textual item from the git config
465
456
sub git_config {
466
457
my $search_key = lc ($_ [0] || " " );
467
458
my $default_value = lc ($_ [1] || " " );
468
459
469
- my $out = git_config_raw();
470
-
471
460
# If we're in a unit test, use the default (don't read the users config)
472
461
if (in_unit_test()) {
473
462
return $default_value ;
@@ -482,6 +471,8 @@ sub git_config {
482
471
print " Parsing git config\n " ;
483
472
}
484
473
474
+ my $out = git_config_raw();
475
+
485
476
foreach my $line (@$out ) {
486
477
if ($line =~ / =/ ) {
487
478
my ($key ,$value ) = split (" =" ,$line ,2);
You can’t perform that action at this time.
0 commit comments