summaryrefslogtreecommitdiff
path: root/gbp/git.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-10-24 17:20:19 +0200
committerGuido Günther <agx@sigxcpu.org>2011-10-26 09:45:10 +0200
commit02efee70bf88c2c87886efa6aad57bad924a508e (patch)
tree460b043dcab21a4952a34769c20f5e25730b6202 /gbp/git.py
parent113ac4ed020c3bf65dbf7517599a8105c521bf91 (diff)
Add GitRepository.add_remote_repo()
Diffstat (limited to 'gbp/git.py')
-rw-r--r--gbp/git.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index a7b5fba..41b83c3 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -710,6 +710,24 @@ class GitRepository(object):
else:
return False
+ def add_remote_repo(self, name, url, tags=True, fetch=False):
+ """
+ Add a tracked remote repository
+
+ @param name: the name to use for the remote
+ @type name: string
+ @param url: the url to add
+ @type url: string
+ @param tags: whether to fetch tags
+ @type tags: bool
+ @param fetch: whether to fetch immediately from the remote side
+ @type fetch: bool
+ """
+ args = [ "add" ]
+ args += [ '--tags' ] if tags else [ '--no-tags']
+ args += [ '--fetch' ] if fetch else []
+ args += [ name, url ]
+ self._git_command("remote", args)
def add_files(self, paths, force=False, index_file=None, work_tree=None):
"""