mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 02:12:17 +02:00
filter-repo: fix possible deadlock in sanity_check_args
I'm a little surprised that stdout buffers must have filled up on MacOS X, but either way we don't have to wait for the '-h' processes to finish before attempting to read stdout. In fact, since we weren't storing the returncode attribute from calling p.wait(), there wasn't much point in doing so. Trying to read all stdout all at once is going to implicitly take until the process finishes anyway, so just do that. Reported-by: Benoit Lefèvre <contact@benoit-lefevre.org> Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
15494bba8a
commit
0375758806
@ -2039,7 +2039,6 @@ EXAMPLES
|
|||||||
# PERF: remove these checks once new enough git versions are common
|
# PERF: remove these checks once new enough git versions are common
|
||||||
p = subproc.Popen('git fast-export -h'.split(),
|
p = subproc.Popen('git fast-export -h'.split(),
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
p.wait()
|
|
||||||
output = p.stdout.read()
|
output = p.stdout.read()
|
||||||
if b'--mark-tags' not in output: # pragma: no cover
|
if b'--mark-tags' not in output: # pragma: no cover
|
||||||
global write_marks
|
global write_marks
|
||||||
@ -2060,7 +2059,6 @@ EXAMPLES
|
|||||||
# diff-tree --combined-all-paths, which is even more important...
|
# diff-tree --combined-all-paths, which is even more important...
|
||||||
p = subproc.Popen('git diff-tree -h'.split(),
|
p = subproc.Popen('git diff-tree -h'.split(),
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
p.wait()
|
|
||||||
output = p.stdout.read()
|
output = p.stdout.read()
|
||||||
if b'--combined-all-paths' not in output:
|
if b'--combined-all-paths' not in output:
|
||||||
# We need a version of git-diff-tree with --combined-all-paths
|
# We need a version of git-diff-tree with --combined-all-paths
|
||||||
|
Loading…
Reference in New Issue
Block a user