From eb9c0e6cda6a574845a5abdd717b53562bcafa7d Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 13 Jan 2011 21:34:59 +0100 Subject: git-create-remote-repo: Don't hardcode 'origin' as remote This makes it possible to create different remote repos from within the same repository. --- gbp/git.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gbp') diff --git a/gbp/git.py b/gbp/git.py index 63749ee9..9fac3ba5 100644 --- a/gbp/git.py +++ b/gbp/git.py @@ -459,6 +459,18 @@ class GitRepository(object): out = self.__git_getoutput('for-each-ref', args)[0] return [ ref.strip() for ref in out ] + def get_remote_repos(self): + """Get all remote repositories""" + out = self.__git_getoutput('remote')[0] + return [ remote.strip() for remote in out ] + + def has_remote_repo(self, name): + """Do we know about a remote named 'name'""" + if name in self.get_remote_repos(): + return True + else: + return False + def format_patches(self, start, end, output_dir): options = [ '-N', '-k', '-o', output_dir, '%s...%s' % (start, end) ] output, ret = self.__git_getoutput('format-patch', options) -- cgit v1.2.3