aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/import_orig.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-04-03 19:11:15 +0200
committerGuido Günther <agx@sigxcpu.org>2017-04-03 19:11:15 +0200
commit844e4f8a7599cbadbf2b69613090163f8c5bf232 (patch)
treef843ae6b281923a90df45462c30b84a9f86e0371 /gbp/scripts/import_orig.py
parent75bf7932691b2a9de6ac7f36328e4e252f054c61 (diff)
import-orig: only abort merge if it got started
This might not be the case when there are e.g. files that would be overwritten by the merge in the workig copy Closes: #859439
Diffstat (limited to 'gbp/scripts/import_orig.py')
-rw-r--r--gbp/scripts/import_orig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index df2b0cb6..f473cd7b 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -132,7 +132,8 @@ class ImportOrigDebianGitRepository(DebianGitRepository):
self.update_ref("refs/heads/%s" % name, sha, msg="gbp import-orig: failure rollback of %s" % name)
elif action == 'abortmerge':
gbp.log.info('Rolling back failed merge of %s' % name)
- self.abort_merge()
+ if os.path.exists(os.path.join(self.git_dir(), 'MERGE_HEAD')):
+ self.abort_merge()
else:
raise GitRepositoryError("Don't know how to %s %s %s" % (action, reftype, name))
except GitRepositoryError as e: