diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-01-13 21:34:59 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-01-13 21:36:58 +0100 |
commit | eb9c0e6cda6a574845a5abdd717b53562bcafa7d (patch) | |
tree | 97b7be482c6bc79d468babbc3aff88baad70b0a8 /gbp | |
parent | acaa01fd5836b8a43b90a73269b3a067e3bc215e (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.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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) |