Skip to content

Commit c2ba4e3

Browse files
pks-tgitster
authored andcommitted
config: don't have setters depend on the_repository
Some of the setters that accept a `struct repository` still implicitly rely on `the_repository` via `git_config_set_multivar_in_file()`. While this function would typically use the caller-provided path, it knows to fall back to using the configuration path indicated by `the_repository`. Adapt those functions to instead use the caller-provided repository. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 76fc990 commit c2ba4e3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

config.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,8 +3220,8 @@ int repo_config_set_worktree_gently(struct repository *r,
32203220
/* Only use worktree-specific config if it is already enabled. */
32213221
if (r->repository_format_worktree_config) {
32223222
char *file = repo_git_path(r, "config.worktree");
3223-
int ret = git_config_set_multivar_in_file_gently(
3224-
file, key, value, NULL, NULL, 0);
3223+
int ret = repo_config_set_multivar_in_file_gently(
3224+
r, file, key, value, NULL, NULL, 0);
32253225
free(file);
32263226
return ret;
32273227
}
@@ -3613,10 +3613,10 @@ int repo_config_set_multivar_gently(struct repository *r, const char *key,
36133613
const char *value_pattern, unsigned flags)
36143614
{
36153615
char *file = repo_git_path(r, "config");
3616-
int res = git_config_set_multivar_in_file_gently(file,
3617-
key, value,
3618-
value_pattern,
3619-
NULL, flags);
3616+
int res = repo_config_set_multivar_in_file_gently(r, file,
3617+
key, value,
3618+
value_pattern,
3619+
NULL, flags);
36203620
free(file);
36213621
return res;
36223622
}
@@ -3626,8 +3626,8 @@ void repo_config_set_multivar(struct repository *r,
36263626
const char *value_pattern, unsigned flags)
36273627
{
36283628
char *file = repo_git_path(r, "config");
3629-
git_config_set_multivar_in_file(file, key, value,
3630-
value_pattern, flags);
3629+
repo_config_set_multivar_in_file(r, file, key, value,
3630+
value_pattern, flags);
36313631
free(file);
36323632
}
36333633

0 commit comments

Comments
 (0)