File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public class Configuration : IDisposable,
1919 private readonly FilePath globalConfigPath ;
2020 private readonly FilePath xdgConfigPath ;
2121 private readonly FilePath systemConfigPath ;
22+ private readonly FilePath programDataConfigPath ;
2223
2324 private ConfigurationSafeHandle configHandle ;
2425
@@ -43,6 +44,7 @@ internal Configuration(
4344 globalConfigPath = globalConfigurationFileLocation ?? Proxy . git_config_find_global ( ) ;
4445 xdgConfigPath = xdgConfigurationFileLocation ?? Proxy . git_config_find_xdg ( ) ;
4546 systemConfigPath = systemConfigurationFileLocation ?? Proxy . git_config_find_system ( ) ;
47+ programDataConfigPath = Proxy . git_config_find_programdata ( ) ;
4648
4749 Init ( repository ) ;
4850 }
@@ -81,6 +83,11 @@ private void Init(Repository repository)
8183 {
8284 Proxy . git_config_add_file_ondisk ( configHandle , systemConfigPath , ConfigurationLevel . System ) ;
8385 }
86+
87+ if ( programDataConfigPath != null )
88+ {
89+ Proxy . git_config_add_file_ondisk ( configHandle , programDataConfigPath , ConfigurationLevel . ProgramData ) ;
90+ }
8491 }
8592
8693 private FilePath NormalizeConfigPath ( FilePath path )
Original file line number Diff line number Diff line change @@ -344,6 +344,9 @@ internal static extern int git_config_delete_multivar(
344344 [ DllImport ( libgit2 ) ]
345345 internal static extern int git_config_find_xdg ( GitBuf xdg_config_path ) ;
346346
347+ [ DllImport ( libgit2 ) ]
348+ internal static extern int git_config_find_programdata ( GitBuf programdata_config_path ) ;
349+
347350 [ DllImport ( libgit2 ) ]
348351 internal static extern void git_config_free ( IntPtr cfg ) ;
349352
Original file line number Diff line number Diff line change @@ -468,6 +468,11 @@ public static FilePath git_config_find_xdg()
468468 return ConvertPath ( NativeMethods . git_config_find_xdg ) ;
469469 }
470470
471+ public static FilePath git_config_find_programdata ( )
472+ {
473+ return ConvertPath ( NativeMethods . git_config_find_programdata ) ;
474+ }
475+
471476 public static void git_config_free ( IntPtr config )
472477 {
473478 NativeMethods . git_config_free ( config ) ;
You can’t perform that action at this time.
0 commit comments