11using System ;
22using System . Collections . Generic ;
33using System . IO ;
4+ using System . Linq ;
45using System . Text ;
5- using Avalonia . Markup . Xaml . MarkupExtensions ;
66
77namespace 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