[PATCH 12/20] delete_tag: Stop executing a command

Mathieu Bridon bochecha at fedoraproject.org
Wed Oct 29 12:57:10 UTC 2014


From: Mathieu Bridon <bochecha at daitauha.fr>

We have a Git API, let's use it, instead of constantly running commands
in subprocesses.
---
 src/pyrpkg/__init__.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py
index ed40654..48edf6c 100644
--- a/src/pyrpkg/__init__.py
+++ b/src/pyrpkg/__init__.py
@@ -1206,8 +1206,12 @@ class Commands(object):
     def delete_tag(self, tagname):
         """Delete a git tag from the repository found at optional path"""
 
-        cmd = ['git', 'tag', '-d', tagname]
-        self._run_command(cmd, cwd=self.path)
+        try:
+            self.repo.delete_tag(tagname)
+
+        except git.GitCommandError as e:
+            raise rpkgError(e)
+
         self.log.info ('Tag %s was deleted' % tagname)
 
     def diff(self, cached=False, files=[]):
-- 
2.1.0



More information about the rel-eng mailing list