submodule-config: reuse config_from_gitmodules in repo_read_gitmodules
authorAntonio Ospite <redacted>
Tue, 26 Jun 2018 10:47:10 +0000 (12:47 +0200)
committerJunio C Hamano <redacted>
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 <redacted>
Acked-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
submodule-config.c
git clone https://git.99rst.org/PROJECT