]> git.ipfire.org Git - thirdparty/git.git/commit - repository.c
repository: repo_submodule_init to take a submodule struct
authorStefan Beller <sbeller@google.com>
Thu, 29 Nov 2018 00:27:53 +0000 (16:27 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Dec 2018 02:42:32 +0000 (11:42 +0900)
commitd5498e087175ad7bbb0460a40cfb55cc3726226d
treed3daba2aa5d3f427a345c3a4386212bbd4668492
parentbcd7337243f4f20091d478c71682d68dd2100207
repository: repo_submodule_init to take a submodule struct

When constructing a struct repository for a submodule for some revision
of the superproject where the submodule is not contained in the index,
it may not be present in the working tree currently either. In that
situation giving a 'path' argument is not useful. Upgrade the
repo_submodule_init function to take a struct submodule instead.
The submodule struct can be obtained via submodule_from_{path, name} or
an artificial submodule struct can be passed in.

While we are at it, rename the repository struct in the repo_submodule_init
function, which is to be initialized, to a name that is not confused with
the struct submodule as easily. Perform such renames in similar functions
as well.

Also move its documentation into the header file.

Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c
builtin/ls-files.c
builtin/submodule--helper.c
repository.c
repository.h
t/helper/test-submodule-nested-repo-config.c