Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15472297
D7558.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7558.diff
View Options
Index: src/applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php
===================================================================
--- src/applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php
+++ src/applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php
@@ -35,6 +35,7 @@
$repository->writeStatusMessage(
PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE,
PhabricatorRepositoryStatusMessage::CODE_OKAY);
+ $this->waitForGitClient();
}
return $err;
Index: src/applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php
===================================================================
--- src/applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php
+++ 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;
}
}
Index: src/applications/diffusion/ssh/DiffusionSSHGitWorkflow.php
===================================================================
--- src/applications/diffusion/ssh/DiffusionSSHGitWorkflow.php
+++ 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/plain
Expires
Sun, Apr 6, 12:34 PM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7426226
Default Alt Text
D7558.diff (1 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