Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93522041
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
Fri, Nov 29, 10:34
Size
722 B
Mime Type
text/x-php
Expires
Sun, Dec 1, 10:34 (2 d)
Engine
blob
Format
Raw Data
Handle
22657581
Attached To
rPH Phabricator
DiffusionGitRequest.php
View Options
<?php
final
class
DiffusionGitRequest
extends
DiffusionRequest
{
protected
function
getSupportsBranches
()
{
return
true
;
}
protected
function
isStableCommit
(
$symbol
)
{
return
preg_match
(
'/^[a-f0-9]{40}
\z
/'
,
$symbol
);
}
public
function
getBranch
()
{
if
(
$this
->
branch
)
{
return
$this
->
branch
;
}
if
(
$this
->
repository
)
{
return
$this
->
repository
->
getDefaultBranch
();
}
throw
new
Exception
(
"Unable to determine branch!"
);
}
protected
function
getResolvableBranchName
(
$branch
)
{
if
(
$this
->
repository
->
isWorkingCopyBare
())
{
return
$branch
;
}
else
{
$remote
=
DiffusionGitBranch
::
DEFAULT_GIT_REMOTE
;
return
$remote
.
'/'
.
$branch
;
}
}
}
Event Timeline
Log In to Comment