1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00

Get rid of git.path configuration, this is really an artifact of my system

being broken and probably macports' fault.
This commit is contained in:
epriestley 2011-03-14 09:42:32 -07:00
parent 4196bfb3ef
commit 5970f9a0ec
6 changed files with 7 additions and 28 deletions

View file

@ -287,9 +287,4 @@ return array(
'controller.oauth-registration' =>
'PhabricatorOAuthDefaultRegistrationController',
// Path to the 'git' binary to execute when running git commands. By default
// this should work fine, but if you have a weird environment you may need
// to set it explicitly (e.g., apache may not have it in its PATH).
'git.path' => 'git',
);

View file

@ -26,13 +26,11 @@ final class DiffusionGitBrowseQuery extends DiffusionBrowseQuery {
$commit = $drequest->getCommit();
$local_path = $repository->getDetail('local-path');
$git = PhabricatorEnv::getEnvConfig('git.path');
try {
list($stdout) = execx(
"(cd %s && %s cat-file -t %s:%s)",
"(cd %s && git cat-file -t %s:%s)",
$local_path,
$git,
$commit,
$path);
} catch (CommandException $e) {
@ -40,9 +38,8 @@ final class DiffusionGitBrowseQuery extends DiffusionBrowseQuery {
if (preg_match('/^fatal: Not a valid object name/', $stderr)) {
// Grab two logs, since the first one is when the object was deleted.
list($stdout) = execx(
'(cd %s && %s log -n2 --format="%%H" %s -- %s)',
'(cd %s && git log -n2 --format="%%H" %s -- %s)',
$local_path,
$git,
$commit,
$path);
$stdout = trim($stdout);
@ -67,9 +64,8 @@ final class DiffusionGitBrowseQuery extends DiffusionBrowseQuery {
}
list($stdout) = execx(
"(cd %s && %s ls-tree -l %s:%s)",
"(cd %s && git ls-tree -l %s:%s)",
$local_path,
$git,
$commit,
$path);

View file

@ -9,7 +9,6 @@
phutil_require_module('phabricator', 'applications/differential/constants/changetype');
phutil_require_module('phabricator', 'applications/diffusion/data/repositorypath');
phutil_require_module('phabricator', 'applications/diffusion/query/browse/base');
phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phutil', 'future/exec');
phutil_require_module('phutil', 'utils');

View file

@ -26,12 +26,10 @@ final class DiffusionGitFileContentQuery extends DiffusionFileContentQuery {
$commit = $drequest->getCommit();
$local_path = $repository->getDetail('local-path');
$git = $drequest->getPathToGitBinary();
list($corpus) = execx(
'(cd %s && %s cat-file blob %s:%s)',
'(cd %s && git cat-file blob %s:%s)',
$local_path,
$git,
$commit,
$path);

View file

@ -39,7 +39,6 @@ class DiffusionGitRequest extends DiffusionRequest {
if ($this->repository) {
$local_path = $this->repository->getDetail('local-path');
$git = $this->getPathToGitBinary();
// TODO: This is not terribly efficient and does not produce terribly
// good error messages, but it seems better to put error handling code
@ -48,16 +47,14 @@ class DiffusionGitRequest extends DiffusionRequest {
$branch = $this->getBranch();
execx(
'(cd %s && %s rev-parse --verify %s)',
'(cd %s && git rev-parse --verify %s)',
$local_path,
$git,
$branch);
if ($this->commit) {
list($commit) = execx(
'(cd %s && %s rev-parse --verify %s)',
'(cd %s && git rev-parse --verify %s)',
$local_path,
$git,
$this->commit);
// Beyond verifying them, expand commit short forms to full 40-character
@ -65,9 +62,8 @@ class DiffusionGitRequest extends DiffusionRequest {
$this->commit = trim($commit);
list($contains) = execx(
'(cd %s && %s branch --contains %s)',
'(cd %s && git branch --contains %s)',
$local_path,
$git,
$this->commit);
$contains = array_filter(explode("\n", $contains));
$found = false;
@ -88,10 +84,6 @@ class DiffusionGitRequest extends DiffusionRequest {
}
public function getPathToGitBinary() {
return PhabricatorEnv::getEnvConfig('git.path');
}
public function getBranch() {
if ($this->branch) {
return $this->branch;

View file

@ -7,7 +7,6 @@
phutil_require_module('phabricator', 'applications/diffusion/request/base');
phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phutil', 'future/exec');