aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-01-13 21:34:59 +0100
committerGuido Günther <agx@sigxcpu.org>2011-01-13 21:36:58 +0100
commiteb9c0e6cda6a574845a5abdd717b53562bcafa7d (patch)
tree97b7be482c6bc79d468babbc3aff88baad70b0a8 /gbp
parentacaa01fd5836b8a43b90a73269b3a067e3bc215e (diff)
git-create-remote-repo: Don't hardcode 'origin' as remote
This makes it possible to create different remote repos from within the same repository.
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py12
1 files changed, 12 insertions, 0 deletions
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)