Skip to content

Commit 6dff26e

Browse files
committed
settings: fix bug in path-type setting reading
If we are asked for a path-type setting then we should always consult Git directly for the value, and not used cached copies of values that were acquired using `git config list` without a `--type` parameter.
1 parent eefca38 commit 6dff26e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/shared/Core/Settings.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ public IEnumerable<string> GetSettingValues(string envarName, string section, st
397397
// Look for a scoped entry that includes the scheme "protocol://example.com" first as
398398
// this is more specific. If `isPath` is true, then re-get the value from the
399399
// `GitConfiguration` with `isPath` specified.
400-
if (configEntries.TryGetValue(queryName, out value) &&
401-
(!isPath || config.TryGet(queryName, isPath, out value)))
400+
if ((isPath && config.TryGet(queryName, isPath, out value)) ||
401+
configEntries.TryGetValue(queryName, out value))
402402
{
403403
yield return value;
404404
}
@@ -408,8 +408,8 @@ public IEnumerable<string> GetSettingValues(string envarName, string section, st
408408
// `isPath` specified.
409409
string scopeWithoutScheme = scope.TrimUntilIndexOf(Uri.SchemeDelimiter);
410410
string queryWithSchemeName = $"{section}.{scopeWithoutScheme}.{property}";
411-
if (configEntries.TryGetValue(queryWithSchemeName, out value) &&
412-
(!isPath || config.TryGet(queryWithSchemeName, isPath, out value)))
411+
if ((isPath && config.TryGet(queryWithSchemeName, isPath, out value)) ||
412+
configEntries.TryGetValue(queryWithSchemeName, out value))
413413
{
414414
yield return value;
415415
}

0 commit comments

Comments
 (0)