aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/import_orig.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-04-04 06:55:02 +0200
committerGuido Günther <agx@sigxcpu.org>2017-04-04 06:55:02 +0200
commit3b70ad2c26a832e44f459f0f659c002603e75378 (patch)
treed2114a844af6a520c47a8fbbfcd8d123193987ba /gbp/scripts/import_orig.py
parent515db2e7837ea7f435e249323c9d1a280cfb7667 (diff)
GitRepository: add is_in_merge()
Diffstat (limited to 'gbp/scripts/import_orig.py')
-rw-r--r--gbp/scripts/import_orig.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index c5703579..5df4d7b0 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -131,9 +131,11 @@ class ImportOrigDebianGitRepository(DebianGitRepository):
gbp.log.info('Rolling back branch %s by resetting it to %s' % (name, sha))
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)
- if os.path.exists(os.path.join(self.git_dir, 'MERGE_HEAD')):
+ if self.is_in_merge():
+ gbp.log.info('Rolling back failed merge of %s' % name)
self.abort_merge()
+ else:
+ gbp.log.info("Nothing to rollback for merge of '%s'" % name)
else:
raise GitRepositoryError("Don't know how to %s %s %s" % (action, reftype, name))
except GitRepositoryError as e: