@@ -52,41 +52,42 @@ internal Configuration(
52
52
private void Init ( Repository repository )
53
53
{
54
54
configHandle = Proxy . git_config_new ( ) ;
55
+ RepositoryHandle repoHandle = ( repository != null ) ? repository . Handle : null ;
55
56
56
- if ( repository != null )
57
+ if ( repoHandle != null )
57
58
{
58
59
//TODO: push back this logic into libgit2.
59
60
// As stated by @carlosmn "having a helper function to load the defaults and then allowing you
60
61
// to modify it before giving it to git_repository_open_ext() would be a good addition, I think."
61
62
// -- Agreed :)
62
63
string repoConfigLocation = Path . Combine ( repository . Info . Path , "config" ) ;
63
- Proxy . git_config_add_file_ondisk ( configHandle , repoConfigLocation , ConfigurationLevel . Local ) ;
64
+ Proxy . git_config_add_file_ondisk ( configHandle , repoConfigLocation , ConfigurationLevel . Local , repoHandle ) ;
64
65
65
- Proxy . git_repository_set_config ( repository . Handle , configHandle ) ;
66
+ Proxy . git_repository_set_config ( repoHandle , configHandle ) ;
66
67
}
67
68
else if ( repoConfigPath != null )
68
69
{
69
- Proxy . git_config_add_file_ondisk ( configHandle , repoConfigPath , ConfigurationLevel . Local ) ;
70
+ Proxy . git_config_add_file_ondisk ( configHandle , repoConfigPath , ConfigurationLevel . Local , repoHandle ) ;
70
71
}
71
72
72
73
if ( globalConfigPath != null )
73
74
{
74
- Proxy . git_config_add_file_ondisk ( configHandle , globalConfigPath , ConfigurationLevel . Global ) ;
75
+ Proxy . git_config_add_file_ondisk ( configHandle , globalConfigPath , ConfigurationLevel . Global , repoHandle ) ;
75
76
}
76
77
77
78
if ( xdgConfigPath != null )
78
79
{
79
- Proxy . git_config_add_file_ondisk ( configHandle , xdgConfigPath , ConfigurationLevel . Xdg ) ;
80
+ Proxy . git_config_add_file_ondisk ( configHandle , xdgConfigPath , ConfigurationLevel . Xdg , repoHandle ) ;
80
81
}
81
82
82
83
if ( systemConfigPath != null )
83
84
{
84
- Proxy . git_config_add_file_ondisk ( configHandle , systemConfigPath , ConfigurationLevel . System ) ;
85
+ Proxy . git_config_add_file_ondisk ( configHandle , systemConfigPath , ConfigurationLevel . System , repoHandle ) ;
85
86
}
86
87
87
88
if ( programDataConfigPath != null )
88
89
{
89
- Proxy . git_config_add_file_ondisk ( configHandle , programDataConfigPath , ConfigurationLevel . ProgramData ) ;
90
+ Proxy . git_config_add_file_ondisk ( configHandle , programDataConfigPath , ConfigurationLevel . ProgramData , repoHandle ) ;
90
91
}
91
92
}
92
93
0 commit comments