From 02efee70bf88c2c87886efa6aad57bad924a508e Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 24 Oct 2011 17:20:19 +0200 Subject: Add GitRepository.add_remote_repo() --- gbp/git.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gbp/git.py') 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): """ -- cgit v1.2.3