From: Nick Coghlan Date: Sun, 9 Apr 2017 08:32:48 +0000 (+1000) Subject: Issue #29798: Handle git worktree in patchcheck (#1057) X-Git-Tag: v2.7.14rc1~219 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6d943a090cffa8925fb5a5d92357dbdb15040c5;p=python Issue #29798: Handle git worktree in patchcheck (#1057) The original attempted fix missed an `isdir()` call in `get_base_branch()`. --- diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index 9f7fb1990d..be46fe3d08 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -74,7 +74,7 @@ def get_git_upstream_remote(): @status("Getting base branch for PR", info=lambda x: x if x is not None else "not a PR branch") def get_base_branch(): - if not os.path.isdir(os.path.join(SRCDIR, '.git')): + if not os.path.exists(os.path.join(SRCDIR, '.git')): # Not a git checkout, so there's no base branch return None version = sys.version_info