From 1c448e0d80c1f201bc03cf737e6bb8ad84e23a19 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Tue, 29 Jun 2021 17:53:30 +0200 Subject: [PATCH] Fix gh_deploy with config-file in the current directory If the config file is specified as relative and is in the current directory, the `dirname` transform came out empty, which `subprocess` doesn't like as `cwd`. --- mkdocs/commands/gh_deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs/commands/gh_deploy.py b/mkdocs/commands/gh_deploy.py index 95ef3bb0be..59f81e2dcc 100644 --- a/mkdocs/commands/gh_deploy.py +++ b/mkdocs/commands/gh_deploy.py @@ -29,7 +29,7 @@ def _is_cwd_git_repo(): def _get_current_sha(repo_path): - proc = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], cwd=repo_path, + proc = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], cwd=repo_path or None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, _ = proc.communicate()