]> git.ipfire.org Git - thirdparty/git.git/commit - config.c
setup: teach discover_git_directory to respect the commondir
authorBrandon Williams <bmwill@google.com>
Wed, 14 Jun 2017 18:07:37 +0000 (11:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Jun 2017 19:56:22 +0000 (12:56 -0700)
commitd3fb71b3cb36971608a46744261e6b5f8802e784
tree809de18f72641a2fd76a3ce00c5a7207a4afc3e9
parentb2141fc1d20e659810245ec6ca1c143c60e033ec
setup: teach discover_git_directory to respect the commondir

Currently 'discover_git_directory' only looks at the gitdir to determine
if a git directory was discovered.  This causes a problem in the event
that the gitdir which was discovered was in fact a per-worktree git
directory and not the common git directory.  This is because the
repository config, which is checked to verify the repository's format,
is stored in the commondir and not in the per-worktree gitdir.  Correct
this behavior by checking the config stored in the commondir.

It will also be of use for callers to have access to the commondir, so
lets also return that upon successfully discovering a git directory.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
config.c
setup.c