From 8afb7ee72ac66c97c12b97c0ae70fbc2adf4c15e Mon Sep 17 00:00:00 2001 From: Maximiliano Curia Date: Sat, 20 Jul 2019 21:59:10 -0300 Subject: 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. --- gbp/scripts/import_orig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py index 14a87cba..8b0b0fe4 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): -- cgit v1.2.3