summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2015-06-01 11:17:13 -0400
committerThan McIntosh <thanm@google.com>2015-06-22 08:00:20 -0400
commitdb75704bfc12546bfbce96aea0be5c283df18314 (patch)
tree5944a458effaa5f8f7297176d2667d87db1b8c67
parent35de228f331101ba17bbc658c3cd910e54725517 (diff)
downloadgit-repo-db75704bfc12546bfbce96aea0be5c283df18314.tar.gz
Fix 'repo cherry-pick' to avoid hanging on commit-msg update.
After performing the actual cherry-pick operation, the code in cherry_pick.py opens a pipe to 'git commit -F' to rewrite the commit message, emits the fixed-up commit msg to the pipe, then waits for 'git commit' to complete. The child 'git' process winds up hanging while reading from the pipe, however, since the parent process still has it open. To fix the hang, change the parent process to close its end of the pipe after it has emitted the message. Change-Id: I5929371e69a5b076f09009d00d40a2c72ac8ac33
-rw-r--r--subcmds/cherry_pick.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/subcmds/cherry_pick.py b/subcmds/cherry_pick.py
index 520e4c32..1f7dffdc 100644
--- a/subcmds/cherry_pick.py
+++ b/subcmds/cherry_pick.py
@@ -76,6 +76,7 @@ change id will be added.
76 capture_stdout = True, 76 capture_stdout = True,
77 capture_stderr = True) 77 capture_stderr = True)
78 p.stdin.write(new_msg) 78 p.stdin.write(new_msg)
79 p.stdin.close()
79 if p.Wait() != 0: 80 if p.Wait() != 0:
80 print("error: Failed to update commit message", file=sys.stderr) 81 print("error: Failed to update commit message", file=sys.stderr)
81 sys.exit(1) 82 sys.exit(1)