From b1b4ee4e389805ae2065eb1de3ce67220f039335 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Sat, 29 Jul 2023 19:23:09 -0700 Subject: [PATCH] hotfix: add temporary .gitignore removal on git import --- pv2/importer/operation.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pv2/importer/operation.py b/pv2/importer/operation.py index e0a254a..8b610b0 100644 --- a/pv2/importer/operation.py +++ b/pv2/importer/operation.py @@ -579,7 +579,7 @@ class GitImport(Import): if not self.__upstream_lookaside: raise err.ConfigurationError(f'{upstream_lookaside} is not valid.') - # pylint: disable=too-many-locals + # pylint: disable=too-many-locals, too-many-statements, too-many-branches def pkg_import(self, skip_lookaside: bool = False): """ Actually perform the import @@ -729,6 +729,14 @@ class GitImport(Import): self.import_lookaside(dest_git_repo_path, self.rpm_name, dest_branch, sources, self.dest_lookaside) + # This is a temporary hack. There are cases that the .gitignore that's + # provided by upstream errorneouly keeps out certain sources, despite + # the fact that they were pushed before. We're killing off any + # .gitignore we find in the root. + dest_gitignore_file = f'{dest_git_repo_path}/.gitignore' + if os.path.exists(dest_gitignore_file): + os.remove(dest_gitignore_file) + gitutil.add_all(dest_repo) verify = dest_repo.is_dirty() if verify: