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,
19
19
private readonly FilePath globalConfigPath ;
20
20
private readonly FilePath xdgConfigPath ;
21
21
private readonly FilePath systemConfigPath ;
22
+ private readonly FilePath programDataConfigPath ;
22
23
23
24
private ConfigurationSafeHandle configHandle ;
24
25
@@ -43,6 +44,7 @@ internal Configuration(
43
44
globalConfigPath = globalConfigurationFileLocation ?? Proxy . git_config_find_global ( ) ;
44
45
xdgConfigPath = xdgConfigurationFileLocation ?? Proxy . git_config_find_xdg ( ) ;
45
46
systemConfigPath = systemConfigurationFileLocation ?? Proxy . git_config_find_system ( ) ;
47
+ programDataConfigPath = Proxy . git_config_find_programdata ( ) ;
46
48
47
49
Init ( repository ) ;
48
50
}
@@ -81,6 +83,11 @@ private void Init(Repository repository)
81
83
{
82
84
Proxy . git_config_add_file_ondisk ( configHandle , systemConfigPath , ConfigurationLevel . System ) ;
83
85
}
86
+
87
+ if ( programDataConfigPath != null )
88
+ {
89
+ Proxy . git_config_add_file_ondisk ( configHandle , programDataConfigPath , ConfigurationLevel . ProgramData ) ;
90
+ }
84
91
}
85
92
86
93
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(
344
344
[ DllImport ( libgit2 ) ]
345
345
internal static extern int git_config_find_xdg ( GitBuf xdg_config_path ) ;
346
346
347
+ [ DllImport ( libgit2 ) ]
348
+ internal static extern int git_config_find_programdata ( GitBuf programdata_config_path ) ;
349
+
347
350
[ DllImport ( libgit2 ) ]
348
351
internal static extern void git_config_free ( IntPtr cfg ) ;
349
352
Original file line number Diff line number Diff line change @@ -468,6 +468,11 @@ public static FilePath git_config_find_xdg()
468
468
return ConvertPath ( NativeMethods . git_config_find_xdg ) ;
469
469
}
470
470
471
+ public static FilePath git_config_find_programdata ( )
472
+ {
473
+ return ConvertPath ( NativeMethods . git_config_find_programdata ) ;
474
+ }
475
+
471
476
public static void git_config_free ( IntPtr config )
472
477
{
473
478
NativeMethods . git_config_free ( config ) ;
You can’t perform that action at this time.
0 commit comments