Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104045720
DiffusionGitUploadPackSSHWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Mar 6, 04:31
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Mar 8, 04:31 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
24721484
Attached To
rPH Phabricator
DiffusionGitUploadPackSSHWorkflow.php
View Options
<?php
final
class
DiffusionGitUploadPackSSHWorkflow
extends
DiffusionGitSSHWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'git-upload-pack'
);
$this
->
setArguments
(
array
(
array
(
'name'
=>
'dir'
,
'wildcard'
=>
true
,
),
));
}
protected
function
executeRepositoryOperations
()
{
$repository
=
$this
->
getRepository
();
$viewer
=
$this
->
getUser
();
$device
=
AlmanacKeys
::
getLiveDevice
();
$skip_sync
=
$this
->
shouldSkipReadSynchronization
();
if
(
$this
->
shouldProxy
())
{
$command
=
$this
->
getProxyCommand
();
if
(
$device
)
{
$this
->
writeClusterEngineLogMessage
(
pht
(
"# Fetch received by
\"
%s
\"
, forwarding to cluster host.
\n
"
,
$device
->
getName
()));
}
}
else
{
$command
=
csprintf
(
'git-upload-pack -- %s'
,
$repository
->
getLocalPath
());
if
(!
$skip_sync
)
{
$cluster_engine
=
id
(
new
DiffusionRepositoryClusterEngine
())
->
setViewer
(
$viewer
)
->
setRepository
(
$repository
)
->
setLog
(
$this
)
->
synchronizeWorkingCopyBeforeRead
();
if
(
$device
)
{
$this
->
writeClusterEngineLogMessage
(
pht
(
"# Cleared to fetch on cluster host
\"
%s
\"
.
\n
"
,
$device
->
getName
()));
}
}
}
$command
=
PhabricatorDaemon
::
sudoCommandAsDaemonUser
(
$command
);
$future
=
id
(
new
ExecFuture
(
'%C'
,
$command
))
->
setEnv
(
$this
->
getEnvironment
());
$err
=
$this
->
newPassthruCommand
()
->
setIOChannel
(
$this
->
getIOChannel
())
->
setCommandChannelFromExecFuture
(
$future
)
->
execute
();
if
(!
$err
)
{
$this
->
waitForGitClient
();
}
return
$err
;
}
}
Event Timeline
Log In to Comment