import hashlib as _hashlib
import logging as _logging
import os.path as _os_path
+import re as _re
import sys as _sys
import pygit2 as _pygit2
_LOG.addHandler(_logging.StreamHandler())
_COMMIT_MESSAGE_ENCODING = 'UTF-8'
+_FOLDING_WHITESPACE_REGEX = _re.compile('\s*\n\s*')
class DirtyIndex(RuntimeError):
path = message_id_path(message_id=message_id)
_LOG.info('deliver {} to {}'.format(message_id, path))
commit_message = message.get('Subject', '<no subject>')
+ if '\n' in commit_message:
+ commit_message = _FOLDING_WHITESPACE_REGEX.sub(' ', commit_message)
author = get_author(message=message)
repository = _pygit2.Repository(_os_path.curdir)
append(