summaryrefslogtreecommitdiff
path: root/gbp/scripts/pull.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/pull.py')
-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):