mirror of
https://github.com/python/cpython.git
synced 2025-12-11 03:20:01 +00:00
bpo-29798: Handle git worktree in make patchcheck (#629)
In git worktree directories, `.git` is a configuration file rather than a subdirectory
This commit is contained in:
parent
8999caeb00
commit
6a6d090612
1 changed files with 4 additions and 1 deletions
|
|
@ -98,7 +98,10 @@ def changed_files(base_branch=None):
|
||||||
cmd += ' --rev qparent'
|
cmd += ' --rev qparent'
|
||||||
with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st:
|
with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st:
|
||||||
return [x.decode().rstrip() for x in st.stdout]
|
return [x.decode().rstrip() for x in st.stdout]
|
||||||
elif os.path.isdir(os.path.join(SRCDIR, '.git')):
|
elif os.path.exists(os.path.join(SRCDIR, '.git')):
|
||||||
|
# We just use an existence check here as:
|
||||||
|
# directory = normal git checkout/clone
|
||||||
|
# file = git worktree directory
|
||||||
if base_branch:
|
if base_branch:
|
||||||
cmd = 'git diff --name-status ' + base_branch
|
cmd = 'git diff --name-status ' + base_branch
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue