config: pass repo to functions that rename or copy sections
Refactor functions that rename or copy config sections to accept a `struct repository` such that we can get rid of the implicit dependency on `the_repository`. Rename the functions accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0c2c37d16b
commit
76fc9906f2
@ -159,7 +159,7 @@ int remove_path_from_gitmodules(const char *path)
|
||||
}
|
||||
strbuf_addstr(§, "submodule.");
|
||||
strbuf_addstr(§, submodule->name);
|
||||
if (git_config_rename_section_in_file(GITMODULES_FILE, sect.buf, NULL) < 0) {
|
||||
if (repo_config_rename_section_in_file(the_repository, GITMODULES_FILE, sect.buf, NULL) < 0) {
|
||||
/* Maybe the user already did that, don't error out here */
|
||||
warning(_("Could not remove .gitmodules entry for %s"), path);
|
||||
strbuf_release(§);
|
||||
|
Reference in New Issue
Block a user