summaryrefslogtreecommitdiffstats
path: root/src/pyfedpkg
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-09-20 13:53:50 -0700
committerJesse Keating <jkeating@redhat.com>2010-09-20 13:53:50 -0700
commita84e02917af598b0cc050694809dd351913ddd73 (patch)
tree930d1c5ba60db7d1fec0c26381a53e72eb2e0ed2 /src/pyfedpkg
parent7783646df117dab495ca6b5831a762cbebda73eb (diff)
downloadfedora-packager-a84e02917af598b0cc050694809dd351913ddd73.tar.gz
fedora-packager-a84e02917af598b0cc050694809dd351913ddd73.tar.xz
fedora-packager-a84e02917af598b0cc050694809dd351913ddd73.zip
Fix up tag commands
Minor clean ups from jochen's submission
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r--src/pyfedpkg/__init__.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 6b9b6a1..9e15057 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -506,16 +506,14 @@ def commit(path=None, message=None, file=None, files=[]):
_run_command(cmd, cwd=path)
return
-def delete_tag(tagname=None):
- """Delete a git tag from the repository"""
+def delete_tag(tagname, path=None):
+ """Delete a git tag from the repository found at optional path"""
- if not tagname:
- raise fedpkgError('Please specified a tagname')
- cmd = ['git', 'tag']
- cmd.extend(['-d'])
- cmd.extend(tagname)
- _run_command(cmd)
- log.info ('Tag %s was deleted' % ', '.join(delete))
+ if not path:
+ path = os.getcwd()
+ cmd = ['git', 'tag', '-d', tagname]
+ _run_command(cmd, cwd=path)
+ log.info ('Tag %s was deleted' % tagname)
def diff(path, cached=False, files=[]):
"""Excute a git diff
@@ -657,7 +655,7 @@ def list_tag(tagname=None):
cmd = ['git', 'tag']
cmd.extend(['-l'])
- if not tagname == '*':
+ if tagname != '*':
cmd.extend([tagname])
# make it so
_run_command(cmd)