Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F423042
DiffusionGitRawDiffQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DiffusionGitRawDiffQuery.php
View Options
<?php
final
class
DiffusionGitRawDiffQuery
extends
DiffusionRawDiffQuery
{
protected
function
newQueryFuture
()
{
$drequest
=
$this
->
getRequest
();
$repository
=
$drequest
->
getRepository
();
$commit
=
$this
->
getAnchorCommit
();
$options
=
array
(
'-M'
,
'-C'
,
'--no-ext-diff'
,
'--no-color'
,
'--src-prefix=a/'
,
'--dst-prefix=b/'
,
'-U'
.(
int
)
$this
->
getLinesOfContext
(),
);
$against
=
$this
->
getAgainstCommit
();
if
(
$against
===
null
)
{
// Check if this is the root commit by seeing if it has parents, since
// `git diff X^ X` does not work if "X" is the initial commit.
list
(
$parents
)
=
$repository
->
execxLocalCommand
(
'log -n 1 %s %s --'
,
'--format=%P'
,
gitsprintf
(
'%s'
,
$commit
));
if
(
strlen
(
trim
(
$parents
)))
{
$against
=
$commit
.
'^'
;
}
else
{
$against
=
ArcanistGitAPI
::
GIT_MAGIC_ROOT_COMMIT
;
}
}
$path
=
$drequest
->
getPath
();
if
(!
phutil_nonempty_string
(
$path
))
{
$path
=
'.'
;
}
return
$repository
->
getLocalCommandFuture
(
'diff %Ls %s %s -- %s'
,
$options
,
gitsprintf
(
'%s'
,
$against
),
gitsprintf
(
'%s'
,
$commit
),
$path
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, May 2, 11:16 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
57012
Default Alt Text
DiffusionGitRawDiffQuery.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment