Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F82640
D7558.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7558.diff
View Options
diff --git a/src/applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php
@@ -35,6 +35,7 @@
$repository->writeStatusMessage(
PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE,
PhabricatorRepositoryStatusMessage::CODE_OKAY);
+ $this->waitForGitClient();
}
return $err;
diff --git a/src/applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php
@@ -21,10 +21,16 @@
$future = new ExecFuture('git-upload-pack %s', $repository->getLocalPath());
- return $this->newPassthruCommand()
+ $err = $this->newPassthruCommand()
->setIOChannel($this->getIOChannel())
->setCommandChannelFromExecFuture($future)
->execute();
+
+ if (!$err) {
+ $this->waitForGitClient();
+ }
+
+ return $err;
}
}
diff --git a/src/applications/diffusion/ssh/DiffusionSSHGitWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHGitWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSSHGitWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSSHGitWorkflow.php
@@ -7,4 +7,17 @@
return parent::writeError($message."\n");
}
+ 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));
+ }
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/yd/5q/dnm2zl3gdkiadri3
Default Alt Text
D7558.diff (2 KB)
Attached To
Mode
D7558: Wait for the Git client to disconnect before exiting in Git SSH workflows
Attached
Detach File
Event Timeline
Log In to Comment