Differential D21510 Diff 51197 src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | protected function getGitResult(ConduitAPIRequest $request) { | ||||
if (!strlen($path)) { | if (!strlen($path)) { | ||||
$path = '.'; | $path = '.'; | ||||
} | } | ||||
$results = array(); | $results = array(); | ||||
$future = $repository->getLocalCommandFuture( | $future = $repository->getLocalCommandFuture( | ||||
// NOTE: --perl-regexp is available only with libpcre compiled in. | // NOTE: --perl-regexp is available only with libpcre compiled in. | ||||
'grep --extended-regexp --null -n --no-color -f - %s -- %s', | 'grep --extended-regexp --null -n --no-color -f - %s -- %s', | ||||
$drequest->getStableCommit(), | gitsprintf('%s', $drequest->getStableCommit()), | ||||
$path); | $path); | ||||
// NOTE: We're writing the pattern on stdin to avoid issues with UTF8 | // NOTE: We're writing the pattern on stdin to avoid issues with UTF8 | ||||
// being mangled by the shell. See T12807. | // being mangled by the shell. See T12807. | ||||
$future->write($grep); | $future->write($grep); | ||||
$binary_pattern = '/Binary file [^:]*:(.+) matches/'; | $binary_pattern = '/Binary file [^:]*:(.+) matches/'; | ||||
$lines = new LinesOfALargeExecFuture($future); | $lines = new LinesOfALargeExecFuture($future); | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |