@@ -52,41 +52,42 @@ internal Configuration(
5252 private void Init ( Repository repository )
5353 {
5454 configHandle = Proxy . git_config_new ( ) ;
55+ RepositoryHandle repoHandle = ( repository != null ) ? repository . Handle : null ;
5556
56- if ( repository != null )
57+ if ( repoHandle != null )
5758 {
5859 //TODO: push back this logic into libgit2.
5960 // As stated by @carlosmn "having a helper function to load the defaults and then allowing you
6061 // to modify it before giving it to git_repository_open_ext() would be a good addition, I think."
6162 // -- Agreed :)
6263 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 ) ;
6465
65- Proxy . git_repository_set_config ( repository . Handle , configHandle ) ;
66+ Proxy . git_repository_set_config ( repoHandle , configHandle ) ;
6667 }
6768 else if ( repoConfigPath != null )
6869 {
69- Proxy . git_config_add_file_ondisk ( configHandle , repoConfigPath , ConfigurationLevel . Local ) ;
70+ Proxy . git_config_add_file_ondisk ( configHandle , repoConfigPath , ConfigurationLevel . Local , repoHandle ) ;
7071 }
7172
7273 if ( globalConfigPath != null )
7374 {
74- Proxy . git_config_add_file_ondisk ( configHandle , globalConfigPath , ConfigurationLevel . Global ) ;
75+ Proxy . git_config_add_file_ondisk ( configHandle , globalConfigPath , ConfigurationLevel . Global , repoHandle ) ;
7576 }
7677
7778 if ( xdgConfigPath != null )
7879 {
79- Proxy . git_config_add_file_ondisk ( configHandle , xdgConfigPath , ConfigurationLevel . Xdg ) ;
80+ Proxy . git_config_add_file_ondisk ( configHandle , xdgConfigPath , ConfigurationLevel . Xdg , repoHandle ) ;
8081 }
8182
8283 if ( systemConfigPath != null )
8384 {
84- Proxy . git_config_add_file_ondisk ( configHandle , systemConfigPath , ConfigurationLevel . System ) ;
85+ Proxy . git_config_add_file_ondisk ( configHandle , systemConfigPath , ConfigurationLevel . System , repoHandle ) ;
8586 }
8687
8788 if ( programDataConfigPath != null )
8889 {
89- Proxy . git_config_add_file_ondisk ( configHandle , programDataConfigPath , ConfigurationLevel . ProgramData ) ;
90+ Proxy . git_config_add_file_ondisk ( configHandle , programDataConfigPath , ConfigurationLevel . ProgramData , repoHandle ) ;
9091 }
9192 }
9293
0 commit comments