Better error management

pull/26/head
Louis Vézina 7 years ago
parent 1980e2e198
commit 6c5419716d

@ -28,7 +28,20 @@ def check_and_apply_update(repo=local_repo, remote_name='origin'):
repo.head.set_target(remote_id)
result = 'Bazarr updated to latest version and restarting.'
os.execlp('python', 'python', os.path.join(os.path.dirname(__file__), 'bazarr.py'))
elif merge_result & pygit2.GIT_MERGE_ANALYSIS_NORMAL:
repo.merge(remote_id)
print repo.index.conflicts
assert repo.index.conflicts is None, 'Conflicts, ahhhh!'
user = repo.default_signature
tree = repo.index.write_tree()
commit = repo.create_commit('HEAD',
user,
user,
'Merge!',
tree,
[repo.head.target, remote_master_id])
repo.state_cleanup()
else:
raise AssertionError('Unknown merge analysis result')
return result

Loading…
Cancel
Save