_git(args=args, wait=True)
+def init(remote=None):
+ """
+ Create an empty nmbug repository.
+
+ This wraps 'git init' with a few extra steps to support subsequent
+ status and commit commands.
+ """
+ with _tempfile.TemporaryDirectory(prefix='nmbug-init.') as workdir:
+ _spawn(
+ args=['git', 'init', '--separate-git-dir', NMBGIT, workdir],
+ wait=True)
+ _git(args=['config', '--unset', 'core.worktree'], wait=True)
+ _git(args=['config', 'core.bare', 'true'], wait=True)
+ # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
+ _git(args=['hash-object', '-w', '--stdin'], input='', wait=True)
+ _git(
+ args=[
+ 'commit', '--allow-empty', '-m', 'Start a new nmbug repository'
+ ],
+ additional_env={'GIT_WORK_TREE': workdir},
+ wait=True)
+
+
def checkout():
"""
Update the notmuch database from Git.
'clone',
'commit',
'fetch',
+ 'init',
'log',
'merge',
'pull',