diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-10-24 19:16:04 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-10-24 19:56:44 +0200 |
commit | 6f03267aedaf7bf159af4016bdf46f21bc67cdd8 (patch) | |
tree | 36cd6fca0b67dce3eae07e6558c4c643a2ddd614 | |
parent | db7cbab003b8edbfb973ef16d8aa291e7714c173 (diff) | |
download | git-buildpackage-6f03267aedaf7bf159af4016bdf46f21bc67cdd8.tar.gz git-buildpackage-6f03267aedaf7bf159af4016bdf46f21bc67cdd8.tar.bz2 git-buildpackage-6f03267aedaf7bf159af4016bdf46f21bc67cdd8.zip |
add GitRepository.get_merge_branch()
-rw-r--r-- | gbp/git.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -72,6 +72,17 @@ class GitRepository(object): if line.startswith('*'): return line.split(' ', 1)[1].strip() + def get_merge_branch(self, branch): + """get the branch we'd merge from""" + self.__check_path() + try: + remote = self.get_config("branch.%s.remote" % branch) + merge = self.get_config("branch.%s.merge" % branch) + except KeyError: + return None + remote += merge.replace("refs/heads","", 1) + return remote + def set_branch(self, branch): """switch to branch 'branch'""" self.__check_path() |