Skip to content

Commit c6665b1

Browse files
author
epriestley
committed
Serve git writes over SSH
Summary: Looks like this is pretty straightforward; same as the reads except mark it as needing PUSH. Test Plan: Ran `git push`, pushed over SSH to a hosted repo. Reviewers: btrahan Reviewed By: btrahan CC: hach-que, aran Maniphest Tasks: T2230 Differential Revision: https://secure.phabricator.com/D7425
1 parent 9a2e45e commit c6665b1

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

scripts/ssh/ssh-exec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
new ConduitSSHWorkflow(),
6464

6565
new DiffusionSSHGitUploadPackWorkflow(),
66+
new DiffusionSSHGitReceivePackWorkflow(),
6667
);
6768

6869
$workflow_names = mpull($workflows, 'getName', 'getName');

src/__phutil_library_map__.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@
527527
'DiffusionRepositoryPath' => 'applications/diffusion/data/DiffusionRepositoryPath.php',
528528
'DiffusionRepositoryTag' => 'applications/diffusion/data/DiffusionRepositoryTag.php',
529529
'DiffusionRequest' => 'applications/diffusion/request/DiffusionRequest.php',
530+
'DiffusionSSHGitReceivePackWorkflow' => 'applications/diffusion/ssh/DiffusionSSHGitReceivePackWorkflow.php',
530531
'DiffusionSSHGitUploadPackWorkflow' => 'applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php',
531532
'DiffusionSSHGitWorkflow' => 'applications/diffusion/ssh/DiffusionSSHGitWorkflow.php',
532533
'DiffusionSSHWorkflow' => 'applications/diffusion/ssh/DiffusionSSHWorkflow.php',
@@ -2716,6 +2717,7 @@
27162717
0 => 'DiffusionController',
27172718
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
27182719
),
2720+
'DiffusionSSHGitReceivePackWorkflow' => 'DiffusionSSHGitWorkflow',
27192721
'DiffusionSSHGitUploadPackWorkflow' => 'DiffusionSSHGitWorkflow',
27202722
'DiffusionSSHGitWorkflow' => 'DiffusionSSHWorkflow',
27212723
'DiffusionSSHWorkflow' => 'PhabricatorSSHWorkflow',
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
final class DiffusionSSHGitReceivePackWorkflow
4+
extends DiffusionSSHGitWorkflow {
5+
6+
public function didConstruct() {
7+
$this->setName('git-receive-pack');
8+
$this->setArguments(
9+
array(
10+
array(
11+
'name' => 'dir',
12+
'wildcard' => true,
13+
),
14+
));
15+
}
16+
17+
public function isReadOnly() {
18+
return false;
19+
}
20+
21+
public function getRequestPath() {
22+
$args = $this->getArgs();
23+
return head($args->getArg('dir'));
24+
}
25+
26+
protected function executeRepositoryOperations(
27+
PhabricatorRepository $repository) {
28+
$future = new ExecFuture(
29+
'git-receive-pack %s',
30+
$repository->getLocalPath());
31+
return $this->passthruIO($future);
32+
}
33+
34+
}

0 commit comments

Comments
 (0)