diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-09-21 15:15:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-21 15:15:24 -0700 |
commit | d845d727cb1935202b61a3b7b6c8cfa7c09bd204 (patch) | |
tree | 7296be39100177a980c2e3d5700371f11dd5b03d /config.c | |
parent | ac8ddd7ba36751a9f6413bb3921fc6797144717e (diff) | |
parent | 4d0efa101bbbc63d8bd1ec0477f027f23b9f573b (diff) | |
download | git-d845d727cb1935202b61a3b7b6c8cfa7c09bd204.tar.gz |
Merge branch 'jk/setup-sequence-update'
There were numerous corner cases in which the configuration files
are read and used or not read at all depending on the directory a
Git command was run, leading to inconsistent behaviour. The code
to set-up repository access at the beginning of a Git process has
been updated to fix them.
* jk/setup-sequence-update:
t1007: factor out repeated setup
init: reset cached config when entering new repo
init: expand comments explaining config trickery
config: only read .git/config from configured repos
test-config: setup git directory
t1302: use "git -C"
pager: handle early config
pager: use callbacks instead of configset
pager: make pager_program a file-local static
pager: stop loading git_default_config()
pager: remove obsolete comment
diff: always try to set up the repository
diff: handle --no-index prefixes consistently
diff: skip implicit no-index check when given --no-index
patch-id: use RUN_SETUP_GENTLY
hash-object: always try to set up the git repository
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -927,9 +927,6 @@ static int git_default_core_config(const char *var, const char *value) return 0; } - if (!strcmp(var, "core.pager")) - return git_config_string(&pager_program, var, value); - if (!strcmp(var, "core.editor")) return git_config_string(&editor_program, var, value); @@ -1289,7 +1286,7 @@ static int do_git_config_sequence(config_fn_t fn, void *data) int ret = 0; char *xdg_config = xdg_config_home("config"); char *user_config = expand_user_path("~/.gitconfig"); - char *repo_config = git_pathdup("config"); + char *repo_config = have_git_dir() ? git_pathdup("config") : NULL; current_parsing_scope = CONFIG_SCOPE_SYSTEM; if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK, 0)) |