Skip to content

Commit 6d3d94c

Browse files
committed
Merge pull request #184 from SurveyMonkey/GH-145_fix_git_push_hang
Fix `git push` hanging when stdout/stderr is big
2 parents a66cfe9 + 3d0e05c commit 6d3d94c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git/db/cmd/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ def get_push_info(repo, remotename_or_url, proc, progress):
127127
# we hope stdout can hold all the data, it should ...
128128
# read the lines manually as it will use carriage returns between the messages
129129
# to override the previous one. This is why we read the bytes manually
130-
digest_process_messages(proc.stderr, progress)
130+
stdout, stderr = proc.communicate()
131+
digest_process_messages(StringIO(stderr), progress)
131132

132133
output = IterableList('name')
133-
for line in proc.stdout.readlines():
134+
for line in stdout.splitlines():
134135
try:
135136
output.append(CmdPushInfo._from_line(repo, remotename_or_url, line))
136137
except ValueError:
@@ -139,7 +140,6 @@ def get_push_info(repo, remotename_or_url, proc, progress):
139140
# END exception handling
140141
# END for each line
141142

142-
finalize_process(proc)
143143
return output
144144

145145

0 commit comments

Comments
 (0)