We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Error while executing gh-deploy
I've successfully deployed a MkDocs site using the gh-deploy command. When I try to deploy some additional changes to my master branch, I get the following error:

```
c:\docs>mkdocs gh-deploy --clean
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: c:\docs\site
INFO    -  Copying 'c:\docs\site' to 'gh-pages' branch and pushing to GitHub.
Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Python34\Scripts\mkdocs.exe\__main__.py", line 9, in <module>
  File "C:\Python34\lib\site-packages\click\core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python34\lib\site-packages\click\core.py", line 644, in main
    rv = self.invoke(ctx)
  File "C:\Python34\lib\site-packages\click\core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python34\lib\site-packages\click\core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python34\lib\site-packages\click\core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "C:\Python34\lib\site-packages\mkdocs\cli.py", line 186, in gh_deploy_command
    gh_deploy.gh_deploy(config, message=message)
  File "C:\Python34\lib\site-packages\mkdocs\gh_deploy.py", line 69, in gh_deploy
    remote_branch)
  File "C:\Python34\lib\site-packages\mkdocs\utils\ghp_import.py", line 163, in ghp_import
    if not try_rebase(remote, branch):
  File "C:\Python34\lib\site-packages\mkdocs\utils\ghp_import.py", line 78, in try_rebase
    if sp.call(cmd) != 0:
  File "C:\Python34\lib\subprocess.py", line 537, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Python34\lib\subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "C:\Python34\lib\subprocess.py", line 1086, in _execute_child
    args = list2cmdline(args)
  File "C:\Python34\lib\subprocess.py", line 663, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: 'str' does not support the buffer interface
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mkdocs/utils/ghp_import.py`
Content:
```
1 #! /usr/bin/env python
2 #
3 # This file is part of the ghp-import package released under
4 # the Tumbolia Public License.
5 
6 #                            Tumbolia Public License
7 
8 # Copyright 2013, Paul Davis <paul.joseph.davis@gmail.com>
9 
10 # Copying and distribution of this file, with or without modification, are
11 # permitted in any medium without royalty provided the copyright notice and this
12 # notice are preserved.
13 
14 # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
15 
16 #   0. opan saurce LOL
17 
18 from __future__ import unicode_literals
19 
20 import errno
21 import logging
22 import os
23 import subprocess as sp
24 import sys
25 import time
26 import unicodedata
27 
28 log = logging.getLogger(__name__)
29 
30 
31 if sys.version_info[0] == 3:
32     def enc(text):
33         if isinstance(text, bytes):
34             return text
35         return text.encode()
36 
37     def dec(text):
38         if isinstance(text, bytes):
39             return text.decode('utf-8')
40         return text
41 
42     def write(pipe, data):
43         try:
44             pipe.stdin.write(data)
45         except IOError as e:
46             if e.errno != errno.EPIPE:
47                 raise
48 else:
49     def enc(text):
50         if isinstance(text, unicode):
51             return text.encode('utf-8')
52         return text
53 
54     def dec(text):
55         if isinstance(text, unicode):
56             return text
57         return text.decode('utf-8')
58 
59     def write(pipe, data):
60         pipe.stdin.write(data)
61 
62 
63 def normalize_path(path):
64     # Fix unicode pathnames on OS X
65     # See: http://stackoverflow.com/a/5582439/44289
66     if sys.platform == "darwin":
67         return unicodedata.normalize("NFKC", dec(path))
68     return path
69 
70 
71 def try_rebase(remote, branch):
72     cmd = ['git', 'rev-list', '--max-count=1', '%s/%s' % (remote, branch)]
73     p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
74     (rev, _) = p.communicate()
75     if p.wait() != 0:
76         return True
77     cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, rev.strip()]
78     if sp.call(cmd) != 0:
79         return False
80     return True
81 
82 
83 def get_config(key):
84     p = sp.Popen(['git', 'config', key], stdin=sp.PIPE, stdout=sp.PIPE)
85     (value, _) = p.communicate()
86     return value.decode('utf-8').strip()
87 
88 
89 def get_prev_commit(branch):
90     cmd = ['git', 'rev-list', '--max-count=1', branch, '--']
91     p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
92     (rev, _) = p.communicate()
93     if p.wait() != 0:
94         return None
95     return rev.decode('utf-8').strip()
96 
97 
98 def mk_when(timestamp=None):
99     if timestamp is None:
100         timestamp = int(time.time())
101     currtz = "%+05d" % (-1 * time.timezone / 36)  # / 3600 * 100
102     return "%s %s" % (timestamp, currtz)
103 
104 
105 def start_commit(pipe, branch, message):
106     uname = dec(get_config("user.name"))
107     email = dec(get_config("user.email"))
108     write(pipe, enc('commit refs/heads/%s\n' % branch))
109     write(pipe, enc('committer %s <%s> %s\n' % (uname, email, mk_when())))
110     write(pipe, enc('data %d\n%s\n' % (len(message), message)))
111     head = get_prev_commit(branch)
112     if head:
113         write(pipe, enc('from %s\n' % head))
114     write(pipe, enc('deleteall\n'))
115 
116 
117 def add_file(pipe, srcpath, tgtpath):
118     with open(srcpath, "rb") as handle:
119         if os.access(srcpath, os.X_OK):
120             write(pipe, enc('M 100755 inline %s\n' % tgtpath))
121         else:
122             write(pipe, enc('M 100644 inline %s\n' % tgtpath))
123         data = handle.read()
124         write(pipe, enc('data %d\n' % len(data)))
125         write(pipe, enc(data))
126         write(pipe, enc('\n'))
127 
128 
129 def add_nojekyll(pipe):
130     write(pipe, enc('M 100644 inline .nojekyll\n'))
131     write(pipe, enc('data 0\n'))
132     write(pipe, enc('\n'))
133 
134 
135 def gitpath(fname):
136     norm = os.path.normpath(fname)
137     return "/".join(norm.split(os.path.sep))
138 
139 
140 def run_import(srcdir, branch, message, nojekyll):
141     cmd = ['git', 'fast-import', '--date-format=raw', '--quiet']
142     kwargs = {"stdin": sp.PIPE}
143     if sys.version_info >= (3, 2, 0):
144         kwargs["universal_newlines"] = False
145     pipe = sp.Popen(cmd, **kwargs)
146     start_commit(pipe, branch, message)
147     for path, _, fnames in os.walk(srcdir):
148         for fn in fnames:
149             fpath = os.path.join(path, fn)
150             fpath = normalize_path(fpath)
151             gpath = gitpath(os.path.relpath(fpath, start=srcdir))
152             add_file(pipe, fpath, gpath)
153     if nojekyll:
154         add_nojekyll(pipe)
155     write(pipe, enc('\n'))
156     pipe.stdin.close()
157     if pipe.wait() != 0:
158         sys.stdout.write(enc("Failed to process commit.\n"))
159 
160 
161 def ghp_import(directory, message, remote='origin', branch='gh-pages'):
162 
163     if not try_rebase(remote, branch):
164         log.error("Failed to rebase %s branch.", branch)
165 
166     nojekyll = True
167 
168     run_import(directory, branch, message, nojekyll)
169 
170     proc = sp.Popen(['git', 'push', remote, branch],
171                     stdout=sp.PIPE, stderr=sp.PIPE)
172     proc.communicate()
173     return proc.wait() == 0
174
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mkdocs/utils/ghp_import.py b/mkdocs/utils/ghp_import.py
--- a/mkdocs/utils/ghp_import.py
+++ b/mkdocs/utils/ghp_import.py
@@ -74,7 +74,7 @@
     (rev, _) = p.communicate()
     if p.wait() != 0:
         return True
-    cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, rev.strip()]
+    cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, dec(rev.strip())]
     if sp.call(cmd) != 0:
         return False
     return True

{"golden_diff": "diff --git a/mkdocs/utils/ghp_import.py b/mkdocs/utils/ghp_import.py\n--- a/mkdocs/utils/ghp_import.py\n+++ b/mkdocs/utils/ghp_import.py\n@@ -74,7 +74,7 @@\n     (rev, _) = p.communicate()\n     if p.wait() != 0:\n         return True\n-    cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, rev.strip()]\n+    cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, dec(rev.strip())]\n     if sp.call(cmd) != 0:\n         return False\n     return True\n", "issue": "Error while executing gh-deploy\nI've successfully deployed a MkDocs site using the gh-deploy command. When I try to deploy some additional changes to my master branch, I get the following error:\n\n```\nc:\\docs>mkdocs gh-deploy --clean\nINFO    -  Cleaning site directory\nINFO    -  Building documentation to directory: c:\\docs\\site\nINFO    -  Copying 'c:\\docs\\site' to 'gh-pages' branch and pushing to GitHub.\nTraceback (most recent call last):\n  File \"C:\\Python34\\lib\\runpy.py\", line 170, in _run_module_as_main\n    \"__main__\", mod_spec)\n  File \"C:\\Python34\\lib\\runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"c:\\Python34\\Scripts\\mkdocs.exe\\__main__.py\", line 9, in <module>\n  File \"C:\\Python34\\lib\\site-packages\\click\\core.py\", line 664, in __call__\n    return self.main(*args, **kwargs)\n  File \"C:\\Python34\\lib\\site-packages\\click\\core.py\", line 644, in main\n    rv = self.invoke(ctx)\n  File \"C:\\Python34\\lib\\site-packages\\click\\core.py\", line 991, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"C:\\Python34\\lib\\site-packages\\click\\core.py\", line 837, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"C:\\Python34\\lib\\site-packages\\click\\core.py\", line 464, in invoke\n    return callback(*args, **kwargs)\n  File \"C:\\Python34\\lib\\site-packages\\mkdocs\\cli.py\", line 186, in gh_deploy_command\n    gh_deploy.gh_deploy(config, message=message)\n  File \"C:\\Python34\\lib\\site-packages\\mkdocs\\gh_deploy.py\", line 69, in gh_deploy\n    remote_branch)\n  File \"C:\\Python34\\lib\\site-packages\\mkdocs\\utils\\ghp_import.py\", line 163, in ghp_import\n    if not try_rebase(remote, branch):\n  File \"C:\\Python34\\lib\\site-packages\\mkdocs\\utils\\ghp_import.py\", line 78, in try_rebase\n    if sp.call(cmd) != 0:\n  File \"C:\\Python34\\lib\\subprocess.py\", line 537, in call\n    with Popen(*popenargs, **kwargs) as p:\n  File \"C:\\Python34\\lib\\subprocess.py\", line 859, in __init__\n    restore_signals, start_new_session)\n  File \"C:\\Python34\\lib\\subprocess.py\", line 1086, in _execute_child\n    args = list2cmdline(args)\n  File \"C:\\Python34\\lib\\subprocess.py\", line 663, in list2cmdline\n    needquote = (\" \" in arg) or (\"\\t\" in arg) or not arg\nTypeError: 'str' does not support the buffer interface\n```\n\n", "before_files": [{"content": "#! /usr/bin/env python\n#\n# This file is part of the ghp-import package released under\n# the Tumbolia Public License.\n\n#                            Tumbolia Public License\n\n# Copyright 2013, Paul Davis <paul.joseph.davis@gmail.com>\n\n# Copying and distribution of this file, with or without modification, are\n# permitted in any medium without royalty provided the copyright notice and this\n# notice are preserved.\n\n# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n#   0. opan saurce LOL\n\nfrom __future__ import unicode_literals\n\nimport errno\nimport logging\nimport os\nimport subprocess as sp\nimport sys\nimport time\nimport unicodedata\n\nlog = logging.getLogger(__name__)\n\n\nif sys.version_info[0] == 3:\n    def enc(text):\n        if isinstance(text, bytes):\n            return text\n        return text.encode()\n\n    def dec(text):\n        if isinstance(text, bytes):\n            return text.decode('utf-8')\n        return text\n\n    def write(pipe, data):\n        try:\n            pipe.stdin.write(data)\n        except IOError as e:\n            if e.errno != errno.EPIPE:\n                raise\nelse:\n    def enc(text):\n        if isinstance(text, unicode):\n            return text.encode('utf-8')\n        return text\n\n    def dec(text):\n        if isinstance(text, unicode):\n            return text\n        return text.decode('utf-8')\n\n    def write(pipe, data):\n        pipe.stdin.write(data)\n\n\ndef normalize_path(path):\n    # Fix unicode pathnames on OS X\n    # See: http://stackoverflow.com/a/5582439/44289\n    if sys.platform == \"darwin\":\n        return unicodedata.normalize(\"NFKC\", dec(path))\n    return path\n\n\ndef try_rebase(remote, branch):\n    cmd = ['git', 'rev-list', '--max-count=1', '%s/%s' % (remote, branch)]\n    p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)\n    (rev, _) = p.communicate()\n    if p.wait() != 0:\n        return True\n    cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, rev.strip()]\n    if sp.call(cmd) != 0:\n        return False\n    return True\n\n\ndef get_config(key):\n    p = sp.Popen(['git', 'config', key], stdin=sp.PIPE, stdout=sp.PIPE)\n    (value, _) = p.communicate()\n    return value.decode('utf-8').strip()\n\n\ndef get_prev_commit(branch):\n    cmd = ['git', 'rev-list', '--max-count=1', branch, '--']\n    p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)\n    (rev, _) = p.communicate()\n    if p.wait() != 0:\n        return None\n    return rev.decode('utf-8').strip()\n\n\ndef mk_when(timestamp=None):\n    if timestamp is None:\n        timestamp = int(time.time())\n    currtz = \"%+05d\" % (-1 * time.timezone / 36)  # / 3600 * 100\n    return \"%s %s\" % (timestamp, currtz)\n\n\ndef start_commit(pipe, branch, message):\n    uname = dec(get_config(\"user.name\"))\n    email = dec(get_config(\"user.email\"))\n    write(pipe, enc('commit refs/heads/%s\\n' % branch))\n    write(pipe, enc('committer %s <%s> %s\\n' % (uname, email, mk_when())))\n    write(pipe, enc('data %d\\n%s\\n' % (len(message), message)))\n    head = get_prev_commit(branch)\n    if head:\n        write(pipe, enc('from %s\\n' % head))\n    write(pipe, enc('deleteall\\n'))\n\n\ndef add_file(pipe, srcpath, tgtpath):\n    with open(srcpath, \"rb\") as handle:\n        if os.access(srcpath, os.X_OK):\n            write(pipe, enc('M 100755 inline %s\\n' % tgtpath))\n        else:\n            write(pipe, enc('M 100644 inline %s\\n' % tgtpath))\n        data = handle.read()\n        write(pipe, enc('data %d\\n' % len(data)))\n        write(pipe, enc(data))\n        write(pipe, enc('\\n'))\n\n\ndef add_nojekyll(pipe):\n    write(pipe, enc('M 100644 inline .nojekyll\\n'))\n    write(pipe, enc('data 0\\n'))\n    write(pipe, enc('\\n'))\n\n\ndef gitpath(fname):\n    norm = os.path.normpath(fname)\n    return \"/\".join(norm.split(os.path.sep))\n\n\ndef run_import(srcdir, branch, message, nojekyll):\n    cmd = ['git', 'fast-import', '--date-format=raw', '--quiet']\n    kwargs = {\"stdin\": sp.PIPE}\n    if sys.version_info >= (3, 2, 0):\n        kwargs[\"universal_newlines\"] = False\n    pipe = sp.Popen(cmd, **kwargs)\n    start_commit(pipe, branch, message)\n    for path, _, fnames in os.walk(srcdir):\n        for fn in fnames:\n            fpath = os.path.join(path, fn)\n            fpath = normalize_path(fpath)\n            gpath = gitpath(os.path.relpath(fpath, start=srcdir))\n            add_file(pipe, fpath, gpath)\n    if nojekyll:\n        add_nojekyll(pipe)\n    write(pipe, enc('\\n'))\n    pipe.stdin.close()\n    if pipe.wait() != 0:\n        sys.stdout.write(enc(\"Failed to process commit.\\n\"))\n\n\ndef ghp_import(directory, message, remote='origin', branch='gh-pages'):\n\n    if not try_rebase(remote, branch):\n        log.error(\"Failed to rebase %s branch.\", branch)\n\n    nojekyll = True\n\n    run_import(directory, branch, message, nojekyll)\n\n    proc = sp.Popen(['git', 'push', remote, branch],\n                    stdout=sp.PIPE, stderr=sp.PIPE)\n    proc.communicate()\n    return proc.wait() == 0\n", "path": "mkdocs/utils/ghp_import.py"}], "after_files": [{"content": "#! /usr/bin/env python\n#\n# This file is part of the ghp-import package released under\n# the Tumbolia Public License.\n\n#                            Tumbolia Public License\n\n# Copyright 2013, Paul Davis <paul.joseph.davis@gmail.com>\n\n# Copying and distribution of this file, with or without modification, are\n# permitted in any medium without royalty provided the copyright notice and this\n# notice are preserved.\n\n# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n#   0. opan saurce LOL\n\nfrom __future__ import unicode_literals\n\nimport errno\nimport logging\nimport os\nimport subprocess as sp\nimport sys\nimport time\nimport unicodedata\n\nlog = logging.getLogger(__name__)\n\n\nif sys.version_info[0] == 3:\n    def enc(text):\n        if isinstance(text, bytes):\n            return text\n        return text.encode()\n\n    def dec(text):\n        if isinstance(text, bytes):\n            return text.decode('utf-8')\n        return text\n\n    def write(pipe, data):\n        try:\n            pipe.stdin.write(data)\n        except IOError as e:\n            if e.errno != errno.EPIPE:\n                raise\nelse:\n    def enc(text):\n        if isinstance(text, unicode):\n            return text.encode('utf-8')\n        return text\n\n    def dec(text):\n        if isinstance(text, unicode):\n            return text\n        return text.decode('utf-8')\n\n    def write(pipe, data):\n        pipe.stdin.write(data)\n\n\ndef normalize_path(path):\n    # Fix unicode pathnames on OS X\n    # See: http://stackoverflow.com/a/5582439/44289\n    if sys.platform == \"darwin\":\n        return unicodedata.normalize(\"NFKC\", dec(path))\n    return path\n\n\ndef try_rebase(remote, branch):\n    cmd = ['git', 'rev-list', '--max-count=1', '%s/%s' % (remote, branch)]\n    p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)\n    (rev, _) = p.communicate()\n    if p.wait() != 0:\n        return True\n    cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, dec(rev.strip())]\n    if sp.call(cmd) != 0:\n        return False\n    return True\n\n\ndef get_config(key):\n    p = sp.Popen(['git', 'config', key], stdin=sp.PIPE, stdout=sp.PIPE)\n    (value, _) = p.communicate()\n    return value.decode('utf-8').strip()\n\n\ndef get_prev_commit(branch):\n    cmd = ['git', 'rev-list', '--max-count=1', branch, '--']\n    p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)\n    (rev, _) = p.communicate()\n    if p.wait() != 0:\n        return None\n    return rev.decode('utf-8').strip()\n\n\ndef mk_when(timestamp=None):\n    if timestamp is None:\n        timestamp = int(time.time())\n    currtz = \"%+05d\" % (-1 * time.timezone / 36)  # / 3600 * 100\n    return \"%s %s\" % (timestamp, currtz)\n\n\ndef start_commit(pipe, branch, message):\n    uname = dec(get_config(\"user.name\"))\n    email = dec(get_config(\"user.email\"))\n    write(pipe, enc('commit refs/heads/%s\\n' % branch))\n    write(pipe, enc('committer %s <%s> %s\\n' % (uname, email, mk_when())))\n    write(pipe, enc('data %d\\n%s\\n' % (len(message), message)))\n    head = get_prev_commit(branch)\n    if head:\n        write(pipe, enc('from %s\\n' % head))\n    write(pipe, enc('deleteall\\n'))\n\n\ndef add_file(pipe, srcpath, tgtpath):\n    with open(srcpath, \"rb\") as handle:\n        if os.access(srcpath, os.X_OK):\n            write(pipe, enc('M 100755 inline %s\\n' % tgtpath))\n        else:\n            write(pipe, enc('M 100644 inline %s\\n' % tgtpath))\n        data = handle.read()\n        write(pipe, enc('data %d\\n' % len(data)))\n        write(pipe, enc(data))\n        write(pipe, enc('\\n'))\n\n\ndef add_nojekyll(pipe):\n    write(pipe, enc('M 100644 inline .nojekyll\\n'))\n    write(pipe, enc('data 0\\n'))\n    write(pipe, enc('\\n'))\n\n\ndef gitpath(fname):\n    norm = os.path.normpath(fname)\n    return \"/\".join(norm.split(os.path.sep))\n\n\ndef run_import(srcdir, branch, message, nojekyll):\n    cmd = ['git', 'fast-import', '--date-format=raw', '--quiet']\n    kwargs = {\"stdin\": sp.PIPE}\n    if sys.version_info >= (3, 2, 0):\n        kwargs[\"universal_newlines\"] = False\n    pipe = sp.Popen(cmd, **kwargs)\n    start_commit(pipe, branch, message)\n    for path, _, fnames in os.walk(srcdir):\n        for fn in fnames:\n            fpath = os.path.join(path, fn)\n            fpath = normalize_path(fpath)\n            gpath = gitpath(os.path.relpath(fpath, start=srcdir))\n            add_file(pipe, fpath, gpath)\n    if nojekyll:\n        add_nojekyll(pipe)\n    write(pipe, enc('\\n'))\n    pipe.stdin.close()\n    if pipe.wait() != 0:\n        sys.stdout.write(enc(\"Failed to process commit.\\n\"))\n\n\ndef ghp_import(directory, message, remote='origin', branch='gh-pages'):\n\n    if not try_rebase(remote, branch):\n        log.error(\"Failed to rebase %s branch.\", branch)\n\n    nojekyll = True\n\n    run_import(directory, branch, message, nojekyll)\n\n    proc = sp.Popen(['git', 'push', remote, branch],\n                    stdout=sp.PIPE, stderr=sp.PIPE)\n    proc.communicate()\n    return proc.wait() == 0\n", "path": "mkdocs/utils/ghp_import.py"}]}