Skip to content

Commit 97b3797

Browse files
Merge pull request #1 from mdellison90-stack/copilot/review-feedback
2 parents 4dab77f + 2301d95 commit 97b3797

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/shared/Core/Interop/Linux/LinuxSettings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.Linq;
45
using System.Text;
5-
using Avalonia.Markup.Xaml.MarkupExtensions;
66

77
namespace GitCredentialManager.Interop.Linux;
88

@@ -15,7 +15,7 @@ public class LinuxSettings : Settings
1515

1616
/// <summary>
1717
/// Reads settings from Git configuration, environment variables, and defaults from the
18-
/// /etc/git-credential-manager.d app configuration directory.
18+
/// /etc/git-credential-manager/config.d app configuration directory.
1919
/// </summary>
2020
public LinuxSettings(IEnvironment environment, IGit git, ITrace trace, IFileSystem fs)
2121
: base(environment, git)
@@ -40,7 +40,7 @@ protected internal override bool TryGetExternalDefault(string section, string sc
4040
: $"{section}.{scope}.{property}";
4141

4242
// Check if the setting exists in the configuration
43-
if (!_extConfigCache?.TryGetValue(name, out value) ?? false)
43+
if (_extConfigCache == null || !_extConfigCache.TryGetValue(name, out value))
4444
{
4545
// No property exists (or failed to read config)
4646
return false;
@@ -63,8 +63,8 @@ private IDictionary<string, string> ReadExternalConfiguration()
6363
return null;
6464
}
6565

66-
// Get all the files in the configuration directory
67-
IEnumerable<string> files = _fs.EnumerateFiles(configDir, "*");
66+
// Get all the files in the configuration directory and sort them alphabetically
67+
IEnumerable<string> files = _fs.EnumerateFiles(configDir, "*").OrderBy(f => Path.GetFileName(f));
6868

6969
// Read the contents of each file and concatenate them together
7070
var combinedFile = new StringBuilder();

0 commit comments

Comments
 (0)