diff --git a/git_superproject.py b/git_superproject.py index f7ccd574..dad6a3de 100644 --- a/git_superproject.py +++ b/git_superproject.py @@ -264,20 +264,10 @@ class Superproject(object): return None projects_missing_commit_ids = [] - superproject_fetchUrl = self._manifest.superproject['remote'].fetchUrl for project in projects: path = project.relpath if not path: continue - # Some manifests that pull projects from the "chromium" GoB - # (remote="chromium"), and have a private manifest that pulls projects - # from both the chromium GoB and "chrome-internal" GoB (remote="chrome"). - # For such projects, one of the remotes will be different from - # superproject's remote. Until superproject, supports multiple remotes, - # don't update the commit ids of remotes that don't match superproject's - # remote. - if project.remote.fetchUrl != superproject_fetchUrl: - continue commit_id = commit_ids.get(path) if commit_id: project.SetRevisionId(commit_id) diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py index b1ae3576..707f7dab 100644 --- a/tests/test_git_superproject.py +++ b/tests/test_git_superproject.py @@ -178,51 +178,6 @@ class SuperprojectTestCase(unittest.TestCase): '' '') - def test_superproject_update_project_revision_id_with_different_remotes(self): - """Test update of commit ids of a manifest with mutiple remotes.""" - manifest = self.getXmlManifest(""" - - - - - - - -""") - self.maxDiff = None - self._superproject = git_superproject.Superproject(manifest, self.repodir) - self.assertEqual(len(self._superproject._manifest.projects), 2) - projects = self._superproject._manifest.projects - data = ('160000 commit 2c2724cb36cd5a9cec6c852c681efc3b7c6b86ea\tart\x00' - '160000 commit e9d25da64d8d365dbba7c8ee00fe8c4473fe9a06\tbootable/recovery\x00') - with mock.patch.object(self._superproject, '_Init', return_value=True): - with mock.patch.object(self._superproject, '_Fetch', return_value=True): - with mock.patch.object(self._superproject, - '_LsTree', - return_value=data): - # Create temporary directory so that it can write the file. - os.mkdir(self._superproject._superproject_path) - manifest_path = self._superproject.UpdateProjectsRevisionId(projects) - self.assertIsNotNone(manifest_path) - with open(manifest_path, 'r') as fp: - manifest_xml = fp.read() - self.assertEqual( - sort_attributes(manifest_xml), - '' - '' - '' - '' - '' - '' - '' - '') - if __name__ == '__main__': unittest.main()