From: Nick Coghlan Date: Sun, 9 Apr 2017 09:22:36 +0000 (+1000) Subject: bpo-29798: Handle git worktree in patchcheck (#1058) (#1060) X-Git-Tag: v3.6.2rc1~247 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c116cb3b3ee38cae229f7e0df0cd2045fe73c27;p=thirdparty%2FPython%2Fcpython.git bpo-29798: Handle git worktree in patchcheck (#1058) (#1060) The original attempted fix missed an `isdir()` call in `get_base_branch()`. (cherry picked from commit 2abfdf5a81383d3b1ed6b7321903a9a168c373c5) --- diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index f4ec7d8a30ea..33a9fead8793 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -70,7 +70,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