@@ -2882,7 +2882,12 @@ int git_config_set_gently(const char *key, const char *value)
void git_config_set(const char *key, const char *value)
{
- git_config_set_multivar(key, value, NULL, 0);
+ repo_config_set(the_repository, key, value);
+}
+
+void repo_config_set(struct repository *r, const char *key, const char *value)
+{
+ repo_config_set_multivar(r, key, value, NULL, 0);
trace2_cmd_set_config(key, value);
}
@@ -3177,14 +3182,32 @@ void git_config_set_multivar_in_file(const char *config_filename,
int git_config_set_multivar_gently(const char *key, const char *value,
const char *value_pattern, unsigned flags)
{
- return git_config_set_multivar_in_file_gently(NULL, key, value, value_pattern,
+ return repo_config_set_multivar_gently(the_repository, key, value,
+ value_pattern, flags);
+}
+
+int repo_config_set_multivar_gently(struct repository *r, const char *key,
+ const char *value,
+ const char *value_pattern, unsigned flags)
+{
+ return git_config_set_multivar_in_file_gently(repo_git_path(r, "config"),
+ key, value, value_pattern,
flags);
}
void git_config_set_multivar(const char *key, const char *value,
const char *value_pattern, unsigned flags)
{
- git_config_set_multivar_in_file(NULL, key, value, value_pattern,
+ repo_config_set_multivar(the_repository, key, value,
+ value_pattern, flags);
+}
+
+void repo_config_set_multivar(struct repository *r, const char *key,
+ const char *value, const char *value_pattern,
+ unsigned flags)
+{
+ git_config_set_multivar_in_file(repo_git_path(r, "config"),
+ key, value, value_pattern,
flags);
}
@@ -258,6 +258,11 @@ int git_config_set_gently(const char *, const char *);
*/
void git_config_set(const char *, const char *);
+/**
+ * write config values to `.git/config`, takes a key/value pair as parameter.
+ */
+void repo_config_set(struct repository *, const char *, const char *);
+
int git_config_parse_key(const char *, char **, size_t *);
/*
@@ -281,6 +286,8 @@ int git_config_parse_key(const char *, char **, size_t *);
int git_config_set_multivar_gently(const char *, const char *, const char *, unsigned);
void git_config_set_multivar(const char *, const char *, const char *, unsigned);
+int repo_config_set_multivar_gently(struct repository *, const char *, const char *, const char *, unsigned);
+void repo_config_set_multivar(struct repository *, const char *, const char *, const char *, unsigned);
int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, unsigned);
/**