From 625e741a4b0de70d9a8cf0c0fd78e4cd9c85108f Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 27 Jun 2023 18:50:15 -0700 Subject: [PATCH] hotfix: add clean up --- importer/operation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/importer/operation.py b/importer/operation.py index 4f21660..edf6037 100644 --- a/importer/operation.py +++ b/importer/operation.py @@ -224,6 +224,7 @@ class SrpmImport(Import): # Raise an error if the tag already exists. Force the importer to tag # manually. if import_tag in repo_tags: + shutil.rmtree(git_repo_path) raise err.GitCommitError(f'Git tag already exists: {import_tag}') verify = repo.is_dirty() @@ -231,11 +232,13 @@ class SrpmImport(Import): gitutil.commit(repo, commit_msg) ref = gitutil.tag(repo, import_tag, commit_msg) gitutil.push(repo, ref=ref) + shutil.rmtree(git_repo_path) return True # The most recent commit is assumed to be tagged also. We will not # push. Force the importer to tag manually. print('Nothing to push') + shutil.rmtree(git_repo_path) return False @property