fix: pre-write SVN password to stdin to avoid deadlock on prompt
This commit is contained in:
@@ -232,13 +232,16 @@ class Mirror:
|
|||||||
text=True,
|
text=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# git svn prompts for password on stderr (no newline) and reads from
|
||||||
|
# stdin. Write password immediately so it's buffered for the prompt.
|
||||||
|
if password:
|
||||||
|
process.stdin.write(password + "\n")
|
||||||
|
process.stdin.flush()
|
||||||
|
|
||||||
for line in process.stdout or []:
|
for line in process.stdout or []:
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
if line:
|
if line:
|
||||||
logger.info("[git svn] %s", line)
|
logger.info("[git svn] %s", line)
|
||||||
if "Password for" in line and password:
|
|
||||||
process.stdin.write(password + "\n")
|
|
||||||
process.stdin.flush()
|
|
||||||
|
|
||||||
ret = process.wait()
|
ret = process.wait()
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user