Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72038273
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
Sun, Jul 14, 09:05
Size
716 B
Mime Type
text/x-php
Expires
Tue, Jul 16, 09:05 (2 d)
Engine
blob
Format
Raw Data
Handle
19022113
Attached To
rPH Phabricator
DiffusionGitRequest.php
View Options
<?php
final
class
DiffusionGitRequest
extends
DiffusionRequest
{
public
function
supportsBranches
()
{
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