aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/git/__init__.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-11-21 23:11:27 +0100
committerGuido Günther <agx@sigxcpu.org>2011-11-21 23:23:18 +0100
commit2faf600a695a8822e8c00a04b946b78dc4bafcba (patch)
tree3dc7e8604ac8480c0a2f2b49f028bd8942bc42a0 /gbp/git/__init__.py
parent644c679a1fdd3c6d96ca5a6bb2ced81e4e9d6f26 (diff)
Use GitArgs in GitRepository.{create,delete}_branch()
Diffstat (limited to 'gbp/git/__init__.py')
-rw-r--r--gbp/git/__init__.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/gbp/git/__init__.py b/gbp/git/__init__.py
index a5934a6f..96e79b1f 100644
--- a/gbp/git/__init__.py
+++ b/gbp/git/__init__.py
@@ -190,10 +190,9 @@ class GitRepository(object):
If rev is None the branch starts form the current HEAD.
"""
- args = [ branch ]
- args += [ rev ] if rev else []
-
- self._git_command("branch", args)
+ args = GitArgs(branch)
+ args.add_true(rev, rev)
+ self._git_command("branch", args.args)
def delete_branch(self, branch, remote=False):
"""
@@ -204,11 +203,12 @@ class GitRepository(object):
@param remote: delete a remote branch
@param remote: C{bool}
"""
- args = [ "-D" ]
- args += [ "-r" ] if remote else []
+ args = GitArgs('-D')
+ args.add_true(remote, '-r')
+ args.add(branch)
if self.branch != branch:
- self._git_command("branch", args + [branch])
+ self._git_command("branch", args.args)
else:
raise GitRepositoryError, "Can't delete the branch you're on"