Skip to content

Commit 2abfdf5

Browse files
authored
Issue #29798: Handle git worktree in patchcheck (#1058)
The original attempted fix missed an `isdir()` call in `get_base_branch()`.
1 parent 64c8f70 commit 2abfdf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tools/scripts/patchcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def get_git_upstream_remote():
7070
@status("Getting base branch for PR",
7171
info=lambda x: x if x is not None else "not a PR branch")
7272
def get_base_branch():
73-
if not os.path.isdir(os.path.join(SRCDIR, '.git')):
73+
if not os.path.exists(os.path.join(SRCDIR, '.git')):
7474
# Not a git checkout, so there's no base branch
7575
return None
7676
version = sys.version_info

0 commit comments

Comments
 (0)