diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2014-11-30 15:24:44 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-12-01 11:00:15 -0800 |
commit | 31e26ebcb512ad234d9725120fb4f5670ff75625 (patch) | |
tree | 065370d0f48d3a715c888e2ee4bf796c45a11f16 /builtin | |
parent | setup.c: detect $GIT_COMMON_DIR check_repository_format_gently() (diff) | |
download | tgif-31e26ebcb512ad234d9725120fb4f5670ff75625.tar.xz |
setup.c: support multi-checkout repo setup
The repo setup procedure is updated to detect $GIT_DIR/commondir and
set $GIT_COMMON_DIR properly.
The core.worktree is ignored when $GIT_COMMON_DIR is set. This is
because the config file is shared in multi-checkout setup, but
checkout directories _are_ different. Making core.worktree effective
in all checkouts mean it's back to a single checkout.
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/rev-parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 4cd44aa45d..5799f3558d 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -762,6 +762,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) free(cwd); continue; } + if (!strcmp(arg, "--git-common-dir")) { + puts(get_git_common_dir()); + continue; + } if (!strcmp(arg, "--resolve-git-dir")) { const char *gitdir = argv[++i]; if (!gitdir) |