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 @@ -434,30 +434,19 @@ sub boolean {
434
434
}
435
435
}
436
436
437
- # Memoize getting the git config
437
+ # Get the git config
438
438
sub git_config_raw {
439
- state $static_config ;
440
-
441
- if ($static_config ) {
442
- # If we already have the config return that
443
- return $static_config ;
444
- }
445
-
446
439
my $cmd = " git config --list" ;
447
440
my @out = ` $cmd ` ;
448
441
449
- $static_config = \@out ;
450
-
451
442
return \@out ;
452
443
}
453
444
454
- # Fetch a textual item from the git config
445
+ # Memoize fetching a textual item from the git config
455
446
sub git_config {
456
447
my $search_key = lc ($_ [0] || " " );
457
448
my $default_value = lc ($_ [1] || " " );
458
449
459
- my $out = git_config_raw();
460
-
461
450
# If we're in a unit test, use the default (don't read the users config)
462
451
if (in_unit_test()) {
463
452
return $default_value ;
@@ -472,6 +461,8 @@ sub git_config {
472
461
print " Parsing git config\n " ;
473
462
}
474
463
464
+ my $out = git_config_raw();
465
+
475
466
foreach my $line (@$out ) {
476
467
if ($line =~ / =/ ) {
477
468
my ($key ,$value ) = split (" =" ,$line ,2);
You can’t perform that action at this time.
0 commit comments