config: rename global config function
Rename this function to a more descriptive name since we want to use the existing name for a new function. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
4ef97dc4cd
commit
ecffa3ed51
|
@ -710,7 +710,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
|
||||||
if (use_global_config) {
|
if (use_global_config) {
|
||||||
char *user_config, *xdg_config;
|
char *user_config, *xdg_config;
|
||||||
|
|
||||||
git_global_config(&user_config, &xdg_config);
|
git_global_config_paths(&user_config, &xdg_config);
|
||||||
if (!user_config)
|
if (!user_config)
|
||||||
/*
|
/*
|
||||||
* It is unknown if HOME/.gitconfig exists, so
|
* It is unknown if HOME/.gitconfig exists, so
|
||||||
|
|
|
@ -1546,7 +1546,7 @@ static int maintenance_register(int argc, const char **argv, const char *prefix)
|
||||||
char *user_config = NULL, *xdg_config = NULL;
|
char *user_config = NULL, *xdg_config = NULL;
|
||||||
|
|
||||||
if (!config_file) {
|
if (!config_file) {
|
||||||
git_global_config(&user_config, &xdg_config);
|
git_global_config_paths(&user_config, &xdg_config);
|
||||||
config_file = user_config;
|
config_file = user_config;
|
||||||
if (!user_config)
|
if (!user_config)
|
||||||
die(_("$HOME not set"));
|
die(_("$HOME not set"));
|
||||||
|
@ -1614,7 +1614,7 @@ static int maintenance_unregister(int argc, const char **argv, const char *prefi
|
||||||
int rc;
|
int rc;
|
||||||
char *user_config = NULL, *xdg_config = NULL;
|
char *user_config = NULL, *xdg_config = NULL;
|
||||||
if (!config_file) {
|
if (!config_file) {
|
||||||
git_global_config(&user_config, &xdg_config);
|
git_global_config_paths(&user_config, &xdg_config);
|
||||||
config_file = user_config;
|
config_file = user_config;
|
||||||
if (!user_config)
|
if (!user_config)
|
||||||
die(_("$HOME not set"));
|
die(_("$HOME not set"));
|
||||||
|
|
|
@ -90,7 +90,7 @@ static char *git_config_val_global(int ident_flag UNUSED)
|
||||||
char *user, *xdg;
|
char *user, *xdg;
|
||||||
size_t unused;
|
size_t unused;
|
||||||
|
|
||||||
git_global_config(&user, &xdg);
|
git_global_config_paths(&user, &xdg);
|
||||||
if (xdg && *xdg) {
|
if (xdg && *xdg) {
|
||||||
normalize_path_copy(xdg, xdg);
|
normalize_path_copy(xdg, xdg);
|
||||||
strbuf_addf(&buf, "%s\n", xdg);
|
strbuf_addf(&buf, "%s\n", xdg);
|
||||||
|
|
4
config.c
4
config.c
|
@ -1987,7 +1987,7 @@ char *git_system_config(void)
|
||||||
return system_config;
|
return system_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
void git_global_config(char **user_out, char **xdg_out)
|
void git_global_config_paths(char **user_out, char **xdg_out)
|
||||||
{
|
{
|
||||||
char *user_config = xstrdup_or_null(getenv("GIT_CONFIG_GLOBAL"));
|
char *user_config = xstrdup_or_null(getenv("GIT_CONFIG_GLOBAL"));
|
||||||
char *xdg_config = NULL;
|
char *xdg_config = NULL;
|
||||||
|
@ -2040,7 +2040,7 @@ static int do_git_config_sequence(const struct config_options *opts,
|
||||||
data, CONFIG_SCOPE_SYSTEM,
|
data, CONFIG_SCOPE_SYSTEM,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
git_global_config(&user_config, &xdg_config);
|
git_global_config_paths(&user_config, &xdg_config);
|
||||||
|
|
||||||
if (xdg_config && !access_or_die(xdg_config, R_OK, ACCESS_EACCES_OK))
|
if (xdg_config && !access_or_die(xdg_config, R_OK, ACCESS_EACCES_OK))
|
||||||
ret += git_config_from_file_with_options(fn, xdg_config, data,
|
ret += git_config_from_file_with_options(fn, xdg_config, data,
|
||||||
|
|
2
config.h
2
config.h
|
@ -382,7 +382,7 @@ int config_error_nonbool(const char *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *git_system_config(void);
|
char *git_system_config(void);
|
||||||
void git_global_config(char **user, char **xdg);
|
void git_global_config_paths(char **user, char **xdg);
|
||||||
|
|
||||||
int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
|
int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue