diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-11-06 16:47:01 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-11-06 17:30:43 +0100 |
commit | 8c22803cefcb380caeb2f821cc625b460c647505 (patch) | |
tree | 5964e12eb6c1413f5cdf993d7750060954ef3642 /gbp/scripts | |
parent | ab744d5c452685b4a21559d1a2dcff8d033011bd (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.
Diffstat (limited to 'gbp/scripts')
-rw-r--r-- | gbp/scripts/pull.py | 8 |
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): |