diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-13 22:37:18 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-13 22:37:18 +0900 |
commit | 8c758f9a67a265ae51beddfd9895d48a42c2af13 (patch) | |
tree | 555c2d42a1ef3f8d69c64a77fbdb0690d529ff3b /config.c | |
parent | Merge branch 'jk/stream-pack-non-delta-clarification' (diff) | |
parent | worktree: add per-worktree config files (diff) | |
download | tgif-8c758f9a67a265ae51beddfd9895d48a42c2af13.tar.xz |
Merge branch 'nd/per-worktree-config'
A fourth class of configuration files (in addition to the
traditional "system wide", "per user in the $HOME directory" and
"per repository in the $GIT_DIR/config") has been introduced so
that different worktrees that share the same repository (hence the
same $GIT_DIR/config file) can use different customization.
* nd/per-worktree-config:
worktree: add per-worktree config files
t1300: extract and use test_cmp_config()
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1695,6 +1695,17 @@ static int do_git_config_sequence(const struct config_options *opts, if (repo_config && !access_or_die(repo_config, R_OK, 0)) ret += git_config_from_file(fn, repo_config, data); + /* + * Note: this should have a new scope, CONFIG_SCOPE_WORKTREE. + * But let's not complicate things before it's actually needed. + */ + if (repository_format_worktree_config) { + char *path = git_pathdup("config.worktree"); + if (!access_or_die(path, R_OK, 0)) + ret += git_config_from_file(fn, path, data); + free(path); + } + current_parsing_scope = CONFIG_SCOPE_CMDLINE; if (git_config_from_parameters(fn, data) < 0) die(_("unable to parse command-line config")); |