summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gbp/git/repository.py6
-rw-r--r--tests/test_GitRepository.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 6389d285..9a67abf1 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1077,7 +1077,8 @@ 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, force=False):
+ def push(self, repo=None, src=None, dst=None, ff_only=True, force=False,
+ tags=False):
"""
Push changes to the remote repo
@@ -1092,10 +1093,13 @@ class GitRepository(object):
@param force: force push, can cause the remote repository to lose
commits; use it with care
@type force: C{bool}
+ @param tags: push all refs under refs/tags, in addition to other refs
+ @type tags: C{bool}
"""
args = GitArgs()
args.add_cond(repo, repo)
args.add_true(force, "-f")
+ args.add_true(tags, "--tags")
# Allow for src == '' to delete dst on the remote
if src != None:
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index 791cf70b..b12f8d41 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -618,6 +618,8 @@ def test_fetch():
>>> clone.push('origin', 'master', force=True)
>>> clone.create_tag('tag3')
>>> clone.push_tag('origin', 'tag3')
+ >>> clone.create_tag('tag4')
+ >>> clone.push('origin', 'master', tags=True)
>>> clone.add_remote_repo('foo', repo_dir)
>>> clone.fetch('foo')
>>> clone.fetch('foo', tags=True)