]> git.ipfire.org Git - thirdparty/git.git/commit - submodule-config.c
submodule-config: reuse config_from_gitmodules in repo_read_gitmodules
authorAntonio Ospite <ao2@ao2.it>
Tue, 26 Jun 2018 10:47:10 +0000 (12:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Jun 2018 20:16:35 +0000 (13:16 -0700)
commitdb64d1127f5c76b721830ba390176cf0d6e59d74
tree8fc531245274ba87fb456f8442b26c4abf128b6c
parent9a0fb3e772922685a8a3ed259afd52d097bd339c
submodule-config: reuse config_from_gitmodules in repo_read_gitmodules

Reuse config_from_gitmodules in repo_read_gitmodules to remove some
duplication and also have a single point where the .gitmodules file is
read.

The change does not introduce any new behavior, the same gitmodules_cb
config callback is still used, which only deals with configuration
specific to submodules.

The check about the repo's worktree is removed from repo_read_gitmodules
because it's already performed in config_from_gitmodules.

The config_from_gitmodules function is moved up in the file â€”unchanged—
before its users to avoid a forward declaration.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule-config.c