]> granicus.if.org Git - python/commitdiff
Issue #29798: Handle git worktree in patchcheck (#1057)
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 9 Apr 2017 08:32:48 +0000 (18:32 +1000)
committerGitHub <noreply@github.com>
Sun, 9 Apr 2017 08:32:48 +0000 (18:32 +1000)
The original attempted fix missed an `isdir()` call in
`get_base_branch()`.

Tools/scripts/patchcheck.py

index 9f7fb1990dca6c5a32676836a5881f7f9c716931..be46fe3d083b0371cae1194566b0fa346fe56c07 100755 (executable)
@@ -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