Skip to content

Commit e0f4e13

Browse files
committed
Don't fall back on missing value
1 parent d403c8e commit e0f4e13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/shared/Core/GitConfiguration.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,19 +513,19 @@ public void Enumerate(GitConfigurationLevel level, GitConfigurationEnumerationCa
513513

514514
public bool TryGet(GitConfigurationLevel level, GitConfigurationType type, string name, out string value)
515515
{
516-
// Use cache for raw types only - typed queries need Git's canonicalization
517516
if (_useCache)
518517
{
519518
EnsureCacheLoaded(type);
520519

521520
ConfigCache cache = _cache[type];
522-
if (cache.IsLoaded && cache.TryGet(name, level, out value))
521+
if (cache.IsLoaded)
523522
{
524-
return true;
523+
// Cache is loaded, use it for the result (whether found or not)
524+
return cache.TryGet(name, level, out value);
525525
}
526526
}
527527

528-
// Fall back to individual git config command for typed queries or cache miss
528+
// Fall back to individual git config command if cache not available
529529
string levelArg = GetLevelFilterArg(level);
530530
string typeArg = GetCanonicalizeTypeArg(type);
531531
using (ChildProcess git = _git.CreateProcess($"config --null {levelArg} {typeArg} {QuoteCmdArg(name)}"))

0 commit comments

Comments
 (0)