]> git.ipfire.org Git - thirdparty/git.git/commit - revision.c
revision: remove "submodule" from opt struct
authorJonathan Tan <jonathantanmy@google.com>
Thu, 9 Sep 2021 18:47:29 +0000 (11:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Sep 2021 21:09:30 +0000 (14:09 -0700)
commit10a0d6ae64ad4fec12ab2c1ed13d1791dde60371
tree77babd696d3936864bdb6d5e4f1849926438a478
parent8eb8dcf94643ca6e7c3f040f3e0bf96e11c7ae47
revision: remove "submodule" from opt struct

Clean up a TODO in revision.h by removing the "submodule" field from
struct setup_revision_opt. This field is only used to specify the ref
store to use, so use rev_info->repo to determine the ref store instead.

The only users of this field are merge-ort.c and merge-recursive.c.
However, both these files specify the superproject as rev_info->repo and
the submodule as setup_revision_opt->submodule. In order to be able to
pass the submodule as rev_info->repo, all commits must be parsed with
the submodule explicitly specified; this patch does that as well. (An
incremental solution in which only some commits are parsed with explicit
submodule will not work, because if the same commit is parsed twice in
different repositories, there will be 2 heap-allocated object structs
corresponding to that commit, and any flag set by the revision walking
mechanism on one of them will not be reflected onto the other.)

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c
merge-recursive.c
revision.c
revision.h