aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-08-04 15:26:13 -0400
committerGuido Günther <agx@sigxcpu.org>2010-08-04 15:26:13 -0400
commitaf2a435443ff050c6a47fa2c58d79fa7f954cc38 (patch)
tree8d91e0ae52d4e85f5f12ae9bc25e2462545fdb13 /gbp
parent34d6d84518d6f0593400af7e041d931b347ecf8a (diff)
Don't update already up to date branches
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/gbp/git.py b/gbp/git.py
index c09ce1ea..4f7ba989 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -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'"""