aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-12-28 19:54:25 +0100
committerGuido Günther <agx@sigxcpu.org>2016-12-28 19:54:25 +0100
commit3b1b9bc6e72480e5ddeb180b1ae0e557c122fa9b (patch)
tree56bc133e1bb7cec01ed5f57845a5efb2a0f8fdb0
parent5cc490ebffb1718bb21873e77587b842f16aa1c0 (diff)
GitRepository: use GitArgs for update_ref
-rw-r--r--gbp/git/repository.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index c7d22764..795d285d 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -534,12 +534,11 @@ class GitRepository(object):
@param msg: the reason for the update
@type msg: C{str}
"""
- args = [ref, new]
- if old:
- args += [old]
- if msg:
- args = ['-m', msg] + args
- self._git_command("update-ref", args)
+ args = GitArgs()
+ args.add_true(msg, '-m', msg)
+ args.add(ref, new)
+ args.add_true(old, old)
+ self._git_command("update-ref", args.args)
def branch_contains(self, branch, commit, remote=False):
"""