2013-10-26 10:46:09 -07:00
|
|
|
<?php
|
|
|
|
|
2015-01-05 06:33:18 +11:00
|
|
|
abstract class DiffusionGitSSHWorkflow extends DiffusionSSHWorkflow {
|
2013-10-26 10:46:09 -07:00
|
|
|
|
|
|
|
protected function writeError($message) {
|
|
|
|
// Git assumes we'll add our own newlines.
|
|
|
|
return parent::writeError($message."\n");
|
|
|
|
}
|
|
|
|
|
2013-11-11 12:27:28 -08:00
|
|
|
protected function waitForGitClient() {
|
|
|
|
$io_channel = $this->getIOChannel();
|
|
|
|
|
|
|
|
// If we don't wait for the client to close the connection, `git` will
|
|
|
|
// consider it an early abort and fail. Sit around until Git is comfortable
|
|
|
|
// that it really received all the data.
|
|
|
|
while ($io_channel->isOpenForReading()) {
|
|
|
|
$io_channel->update();
|
|
|
|
$this->getErrorChannel()->flush();
|
|
|
|
PhutilChannel::waitForAny(array($io_channel));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 10:46:09 -07:00
|
|
|
}
|