Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/shared/Core/Interop/Linux/LinuxSettings.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Avalonia.Markup.Xaml.MarkupExtensions;

namespace GitCredentialManager.Interop.Linux;

Expand All @@ -15,7 +15,7 @@ public class LinuxSettings : Settings

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

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

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

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