From 8c22803cefcb380caeb2f821cc625b460c647505 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 6 Nov 2011 16:47:01 +0100 Subject: 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. --- gbp/scripts/pull.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gbp/scripts') 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): -- cgit v1.2.3