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

Tools/scripts/patchcheck.py

index f4ec7d8a30ea23dae92da9d346b89d62f4eeab5a..33a9fead879325c41d6a8f7f605b13604b9e2c85 100755 (executable)
@@ -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