Skip to content
Snippets Groups Projects
Commit f38d7b26 authored by Mark Hall's avatar Mark Hall
Browse files

Handle merge errors more cleanly

parent 856e06d6
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
## Development ():
* **Bugfix**: Handle git merge errors more cleanly
## 0.9.4 (11.03.2020):
* **New**: Added support for marking up signatures
......
......@@ -51,6 +51,7 @@ def repository(request, rid):
repo.remotes.origin.fetch()
repo.remotes.origin.pull()
except:
repo.git.checkout('--')
errors.append({'msg': _('Fetching changes failed'),
'level': 'alert'})
try:
......@@ -107,10 +108,13 @@ def local_merge(request, rid):
repository.heads.master.checkout()
repository.remotes.origin.pull()
repository.heads[request.user.username].checkout()
# Merge them in
repository.git.merge('master')
# Pull any branch changes
repository.remotes.origin.pull()
# Push all changes
repository.remotes.origin.push()
try:
# Merge them in
repository.git.merge('master')
# Pull any branch changes
repository.remotes.origin.pull()
# Push all changes
repository.remotes.origin.push()
except:
repository.git.merge('--abort')
return HttpResponse('', status=200)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment