summaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-08-02 21:49:22 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-02 23:26:46 +0200
commit2184d4ba0cb86a7f40153cd46b03d3fa75b247d9 (patch)
tree316c452a7128bcd7a37321349871e61145144db8 /setup.c
parentsubmodule: check for unmerged .gitmodules outside of config parsing (diff)
downloadgit-2184d4ba0cb86a7f40153cd46b03d3fa75b247d9.tar.xz
git-2184d4ba0cb86a7f40153cd46b03d3fa75b247d9.zip
submodule: merge repo_read_gitmodules and gitmodules_config
Since 69aba5329 (submodule: add repo_read_gitmodules) there have been two ways to load a repository's .gitmodules file: 'repo_read_gitmodules()' is used if you have a repository object you are working with or 'gitmodules_config()' if you are implicitly working with 'the_repository'. Merge the logic of these two functions to remove duplicate code. In addition, 'repo_read_gitmodules()' can segfault by passing in a NULL pointer to 'git_config_from_file()' if a repository doesn't have a worktree. Instead check for the existence of a worktree before attempting to load the .gitmodules file. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
0 files changed, 0 insertions, 0 deletions