hotfix: add temporary .gitignore removal on git import

This commit is contained in:
Louis Abel 2023-07-29 19:23:09 -07:00
parent 8a8fe26b95
commit b1b4ee4e38
Signed by: label
GPG Key ID: 2A6975660E424560
1 changed files with 9 additions and 1 deletions

View File

@ -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: