aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximiliano Curia <maxy@gnuservers.com.ar>2019-07-20 21:59:10 -0300
committerGuido G√ľnther <agx@sigxcpu.org>2019-07-21 10:10:49 +0200
commit8afb7ee72ac66c97c12b97c0ae70fbc2adf4c15e (patch)
treec2e0b7a25f2e7d32a7351d8964845963c27fd321
parentd1960b3dc0dfbb6be2183e555e615864468b234c (diff)
import-orig/merge_replace Avoid calling force_head
The debian_merge_by_replace function ends up calling force_head, but up to this point the current branch could be anything, and thus when called from a feature branch the latest commits get lost.
-rw-r--r--gbp/scripts/import_orig.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 14a87cb..8b0b0fe 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -259,7 +259,9 @@ def debian_branch_merge_by_replace(repo, tag, version, options):
repo.update_ref("refs/heads/%s" % options.debian_branch, commit,
msg="gbp: Updating %s after import of %s" % (options.debian_branch,
tag))
- repo.force_head(commit, hard=True)
+ current_branch = repo.get_branch()
+ if current_branch == options.debian_branch:
+ repo.force_head(commit, hard=True)
def debian_branch_merge_by_merge(repo, tag, version, options):