summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-11-06 16:47:01 +0100
committerGuido Günther <agx@sigxcpu.org>2011-11-06 17:30:43 +0100
commit8c22803cefcb380caeb2f821cc625b460c647505 (patch)
tree5964e12eb6c1413f5cdf993d7750060954ef3642
parentab744d5c452685b4a21559d1a2dcff8d033011bd (diff)
gbp-pull: massive speedup by just updating the ref
to the remote's SHA1 instead of checking out the branch and doing a fast-forward merge.
-rw-r--r--gbp/scripts/pull.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gbp/scripts/pull.py b/gbp/scripts/pull.py
index 69ad1a6..3502efe 100644
--- a/gbp/scripts/pull.py
+++ b/gbp/scripts/pull.py
@@ -59,8 +59,12 @@ def fast_forward_branch(branch, repo, options):
if update:
gbp.log.info("Updating '%s'" % branch)
- repo.set_branch(branch)
- repo.merge(remote)
+ if repo.branch == branch:
+ repo.merge(remote)
+ else:
+ sha1 = repo.rev_parse(remote)
+ repo.update_ref("refs/heads/%s" % branch, sha1,
+ msg="gbp: forward %s to %s" % (branch, remote))
return update
def main(argv):