summaryrefslogtreecommitdiff
path: root/replace-object.c
diff options
context:
space:
mode:
authorLibravatar Stefan Beller <sbeller@google.com>2018-12-06 13:26:55 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-12-09 10:54:19 +0900
commitbe76c2128234d94b47f7087152ee55d08bb65d88 (patch)
treecccb0afefb56c39fc03cd633485d5a5e2a05290b /replace-object.c
parentsubmodule.c: fetch in submodules git directory instead of in worktree (diff)
downloadtgif-be76c2128234d94b47f7087152ee55d08bb65d88.tar.xz
fetch: ensure submodule objects fetched
Currently when git-fetch is asked to recurse into submodules, it dispatches a plain "git-fetch -C <submodule-dir>" (with some submodule related options such as prefix and recusing strategy, but) without any information of the remote or the tip that should be fetched. But this default fetch is not sufficient, as a newly fetched commit in the superproject could point to a commit in the submodule that is not in the default refspec. This is common in workflows like Gerrit's. When fetching a Gerrit change under review (from refs/changes/??), the commits in that change likely point to submodule commits that have not been merged to a branch yet. Fetch a submodule object by id if the object that the superproject points to, cannot be found. For now this object is fetched from the 'origin' remote as we defer getting the default remote to a later patch. A list of new submodule commits are already generated in certain conditions (by check_for_new_submodule_commits()); this new feature invokes that function in more situations. The submodule checks were done only when a ref in the superproject changed, these checks were extended to also be performed when fetching into FETCH_HEAD for completeness, and add a test for that too. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'replace-object.c')
0 files changed, 0 insertions, 0 deletions