@@ -3697,9 +3697,11 @@ static int section_name_is_ok(const char *name)
36973697#define GIT_CONFIG_MAX_LINE_LEN (512 * 1024)
36983698
36993699/* if new_name == NULL, the section is removed instead */
3700- static int git_config_copy_or_rename_section_in_file (const char * config_filename ,
3701- const char * old_name ,
3702- const char * new_name , int copy )
3700+ static int repo_config_copy_or_rename_section_in_file (
3701+ struct repository * r ,
3702+ const char * config_filename ,
3703+ const char * old_name ,
3704+ const char * new_name , int copy )
37033705{
37043706 int ret = 0 , remove = 0 ;
37053707 char * filename_buf = NULL ;
@@ -3720,7 +3722,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
37203722 }
37213723
37223724 if (!config_filename )
3723- config_filename = filename_buf = git_pathdup ( "config" );
3725+ config_filename = filename_buf = repo_git_path ( r , "config" );
37243726
37253727 out_fd = hold_lock_file_for_update (& lock , config_filename , 0 );
37263728 if (out_fd < 0 ) {
@@ -3863,28 +3865,28 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
38633865 return ret ;
38643866}
38653867
3866- int git_config_rename_section_in_file ( const char * config_filename ,
3867- const char * old_name , const char * new_name )
3868+ int repo_config_rename_section_in_file ( struct repository * r , const char * config_filename ,
3869+ const char * old_name , const char * new_name )
38683870{
3869- return git_config_copy_or_rename_section_in_file ( config_filename ,
3871+ return repo_config_copy_or_rename_section_in_file ( r , config_filename ,
38703872 old_name , new_name , 0 );
38713873}
38723874
3873- int git_config_rename_section ( const char * old_name , const char * new_name )
3875+ int repo_config_rename_section ( struct repository * r , const char * old_name , const char * new_name )
38743876{
3875- return git_config_rename_section_in_file ( NULL , old_name , new_name );
3877+ return repo_config_rename_section_in_file ( r , NULL , old_name , new_name );
38763878}
38773879
3878- int git_config_copy_section_in_file ( const char * config_filename ,
3879- const char * old_name , const char * new_name )
3880+ int repo_config_copy_section_in_file ( struct repository * r , const char * config_filename ,
3881+ const char * old_name , const char * new_name )
38803882{
3881- return git_config_copy_or_rename_section_in_file ( config_filename ,
3883+ return repo_config_copy_or_rename_section_in_file ( r , config_filename ,
38823884 old_name , new_name , 1 );
38833885}
38843886
3885- int git_config_copy_section ( const char * old_name , const char * new_name )
3887+ int repo_config_copy_section ( struct repository * r , const char * old_name , const char * new_name )
38863888{
3887- return git_config_copy_section_in_file ( NULL , old_name , new_name );
3889+ return repo_config_copy_section_in_file ( r , NULL , old_name , new_name );
38883890}
38893891
38903892/*
0 commit comments