Skip to content

Commit 4a7bb5b

Browse files
peffgitster
authored andcommitted
config: eliminate config_exclusive_filename
This is a magic global variable that was intended as an override to the usual git-config lookup process. Once upon a time, you could specify GIT_CONFIG to any git program, and it would look only at that file. This turned out to be confusing and cause a lot of bugs for little gain. As a result, dc87183 (Only use GIT_CONFIG in "git config", not other programs, 2008-06-30) took this away for all callers except git-config. Since git-config no longer uses it either, the variable can just go away. As the diff shows, nobody was setting to anything except NULL, so we can just replace any sites where it was read with NULL. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 270a344 commit 4a7bb5b

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

cache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,8 +1140,6 @@ extern const char *get_commit_output_encoding(void);
11401140

11411141
extern int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
11421142

1143-
extern const char *config_exclusive_filename;
1144-
11451143
#define MAX_GITNAME (1000)
11461144
extern char git_default_email[MAX_GITNAME];
11471145
extern char git_default_name[MAX_GITNAME];

config.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ static config_file *cf;
2626

2727
static int zlib_compression_seen;
2828

29-
const char *config_exclusive_filename = NULL;
30-
3129
static void lowercase(char *p)
3230
{
3331
for (; *p; p++)
@@ -936,7 +934,7 @@ int git_config_with_options(config_fn_t fn, void *data,
936934

937935
int git_config(config_fn_t fn, void *data)
938936
{
939-
return git_config_with_options(fn, data, config_exclusive_filename);
937+
return git_config_with_options(fn, data, NULL);
940938
}
941939

942940
/*
@@ -1435,8 +1433,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
14351433
int git_config_set_multivar(const char *key, const char *value,
14361434
const char *value_regex, int multi_replace)
14371435
{
1438-
return git_config_set_multivar_in_file(config_exclusive_filename,
1439-
key, value, value_regex,
1436+
return git_config_set_multivar_in_file(NULL, key, value, value_regex,
14401437
multi_replace);
14411438
}
14421439

@@ -1562,8 +1559,7 @@ int git_config_rename_section_in_file(const char *config_filename,
15621559

15631560
int git_config_rename_section(const char *old_name, const char *new_name)
15641561
{
1565-
return git_config_rename_section_in_file(config_exclusive_filename,
1566-
old_name, new_name);
1562+
return git_config_rename_section_in_file(NULL, old_name, new_name);
15671563
}
15681564

15691565
/*

0 commit comments

Comments
 (0)