def METHOD_NAME(git, srcdir, opts):
    cmd = ['git', 'fast-import', '--date-format=raw', '--quiet']
    kwargs = {
        "stdin": sp.PIPE,
        "shell": opts.use_shell
    }
    if sys.version_info >= (3, 2, 0):
        kwargs["universal_newlines"] = False
    pipe = sp.Popen(cmd, **kwargs)
    start_commit(pipe, git, opts.branch, opts.mesg)
    for path, dnames, fnames in os.walk(srcdir, followlinks=opts.followlinks):
        for fn in fnames:
            fpath = os.path.join(path, fn)
            fpath = normalize_path(fpath)
            gpath = gitpath(os.path.relpath(fpath, start=srcdir))
            add_file(pipe, fpath, gpath)
    if opts.nojekyll:
        add_nojekyll(pipe)
    if opts.cname is not None:
        add_cname(pipe, opts.cname)
    write(pipe, enc('\n'))
    pipe.stdin.close()
    if pipe.wait() != 0:
        sys.stdout.write(enc("Failed to process commit.\n"))