fix: pre-write SVN password to stdin to avoid deadlock on prompt

This commit is contained in:
2026-06-23 13:33:11 +02:00
parent 2422673584
commit 3536053b44
+6 -3
View File
@@ -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: