[submodule_update] Don't delete source-of-truth submodules
The `name` field in .gitmodules entries is generated by submodule_update
and is used to map the Jiri project name to the submodule. Therefore,
submodules that don't have corresponding Jiri projects need not have the
`name` field set. So we can use the presence/absence of the `name` field
to determine whether a submodule is the source of truth or whether it's
still being mirrored from Jiri, and don't attempt to delete such
submodules.
Bug: 326595281
Change-Id: Ib8a4a1a95d316380a2d5c2d36a9b40f6d1036331
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/infra/+/997592
Reviewed-by: Danielle Kay <danikay@google.com>
Commit-Queue: Oliver Newman <olivernewman@google.com>
3 files changed