diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-08-04 15:26:13 -0400 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-08-04 15:26:13 -0400 |
commit | af2a435443ff050c6a47fa2c58d79fa7f954cc38 (patch) | |
tree | 8d91e0ae52d4e85f5f12ae9bc25e2462545fdb13 /gbp | |
parent | 34d6d84518d6f0593400af7e041d931b347ecf8a (diff) |
Don't update already up to date branches
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -118,13 +118,19 @@ class GitRepository(object): return remote def is_fast_forward(self, from_branch, to_branch): - """check if an update from from_branch to to_branch would be a fast forward""" + """check if an update from from_branch to to_branch would be a fast + forward or if the branch is uptodate already""" out = self.__git_getoutput('rev-list', ["--left-right", "%s...%s" % (from_branch, to_branch)])[0] + + if not out: # already up to date + return True, True + for line in out: if line.startswith("<"): - return False - return True + return False, False + + return True, False def set_branch(self, branch): """switch to branch 'branch'""" |