summaryrefslogtreecommitdiff
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 7d52216..6389d28 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1077,7 +1077,7 @@ class GitRepository(object):
args += [ repo ] if repo else []
self._git_command("pull", args)
- def push(self, repo=None, src=None, dst=None, ff_only=True):
+ def push(self, repo=None, src=None, dst=None, ff_only=True, force=False):
"""
Push changes to the remote repo
@@ -1089,9 +1089,13 @@ class GitRepository(object):
@type dst: C{str}
@param ff_only: only push if it's a fast forward update
@type ff_only: C{bool}
+ @param force: force push, can cause the remote repository to lose
+ commits; use it with care
+ @type force: C{bool}
"""
args = GitArgs()
args.add_cond(repo, repo)
+ args.add_true(force, "-f")
# Allow for src == '' to delete dst on the remote
if src != None:
@@ -1101,6 +1105,7 @@ class GitRepository(object):
if not ff_only:
refspec = '+%s' % refspec
args.add(refspec)
+
self._git_command("push", args.args)
def push_tag(self, repo, tag):