From b8c84483a55b575277ab791c6834a8682d47f1af Mon Sep 17 00:00:00 2001 From: Jack Neus Date: Tue, 15 Jun 2021 14:28:30 +0000 Subject: [PATCH] repo: improve duplicate default check If one default is totally empty, we don't need to fail. BUG=b:187795796 TEST=unit tests Change-Id: Id226a7a7cd183dbdee58f4681b84885cc9211375 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/309102 Reviewed-by: Mike Frysinger Tested-by: Jack Neus --- manifest_xml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest_xml.py b/manifest_xml.py index 09cae6f5..ab4be2f5 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -791,9 +791,10 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md for node in itertools.chain(*node_list): if node.nodeName == 'default': new_default = self._ParseDefault(node) + emptyDefault = not node.hasAttributes() and not node.hasChildNodes() if self._default is None: self._default = new_default - elif new_default != self._default: + elif not emptyDefault and new_default != self._default: raise ManifestParseError('duplicate default in %s' % (self.manifestFile))