mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Fix incremental syncs for prjs with submodules
When performing an incremental sync (re-running repo init with an updated manifest revision) with --fetch-submodules or sync-s=true, there is an attempt to get a list of all projects (including submodules) before projects are actually fetched. However, we can only list submodules of a project if we have already fetched its revision. Instead of throwing an error when we don't have the revision, assume there are no submodules for that project. In the sync cmd, we already update the list of projects to include submodules after fetching superprojects. Change-Id: I48bc68c48b5b10117356b18f5375d17f9a89ec05 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/439761 Commit-Queue: Kaushik Lingarkar <kaushik.lingarkar@linaro.org> Tested-by: Kaushik Lingarkar <kaushik.lingarkar@linaro.org> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Nasser Grainawi <nasser.grainawi@linaro.org>
This commit is contained in:
parent
454fdaf119
commit
584863fb5e
@ -2296,7 +2296,9 @@ class Project:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
rev = self.GetRevisionId()
|
rev = self.GetRevisionId()
|
||||||
except GitError:
|
except (GitError, ManifestInvalidRevisionError):
|
||||||
|
# The git repo may be outdated (i.e. not fetched yet) and querying
|
||||||
|
# its submodules using the revision may not work; so return here.
|
||||||
return []
|
return []
|
||||||
return get_submodules(self.gitdir, rev)
|
return get_submodules(self.gitdir, rev)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user