Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98227257
DiffusionGitRequest.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
Sat, Jan 11, 06:16
Size
833 B
Mime Type
text/x-php
Expires
Mon, Jan 13, 06:16 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23538168
Attached To
rPH Phabricator
DiffusionGitRequest.php
View Options
<?php
/**
* @group diffusion
*/
final
class
DiffusionGitRequest
extends
DiffusionRequest
{
protected
function
getSupportsBranches
()
{
return
true
;
}
protected
function
didInitialize
()
{
if
(!
$this
->
commit
)
{
return
;
}
$this
->
expandCommitName
();
}
public
function
getBranch
()
{
if
(
$this
->
branch
)
{
return
$this
->
branch
;
}
if
(
$this
->
repository
)
{
return
$this
->
repository
->
getDefaultBranch
();
}
throw
new
Exception
(
"Unable to determine branch!"
);
}
public
function
getCommit
()
{
if
(
$this
->
commit
)
{
return
$this
->
commit
;
}
if
(
$this
->
repository
->
isWorkingCopyBare
())
{
return
$this
->
getBranch
();
}
else
{
$remote
=
DiffusionBranchInformation
::
DEFAULT_GIT_REMOTE
;
return
$remote
.
'/'
.
$this
->
getBranch
();
}
}
}
Event Timeline
Log In to Comment