1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +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' => 'controller.oauth-registration' =>
'PhabricatorOAuthDefaultRegistrationController', '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(); $commit = $drequest->getCommit();
$local_path = $repository->getDetail('local-path'); $local_path = $repository->getDetail('local-path');
$git = PhabricatorEnv::getEnvConfig('git.path');
try { try {
list($stdout) = execx( list($stdout) = execx(
"(cd %s && %s cat-file -t %s:%s)", "(cd %s && git cat-file -t %s:%s)",
$local_path, $local_path,
$git,
$commit, $commit,
$path); $path);
} catch (CommandException $e) { } catch (CommandException $e) {
@ -40,9 +38,8 @@ final class DiffusionGitBrowseQuery extends DiffusionBrowseQuery {
if (preg_match('/^fatal: Not a valid object name/', $stderr)) { if (preg_match('/^fatal: Not a valid object name/', $stderr)) {
// Grab two logs, since the first one is when the object was deleted. // Grab two logs, since the first one is when the object was deleted.
list($stdout) = execx( list($stdout) = execx(
'(cd %s && %s log -n2 --format="%%H" %s -- %s)', '(cd %s && git log -n2 --format="%%H" %s -- %s)',
$local_path, $local_path,
$git,
$commit, $commit,
$path); $path);
$stdout = trim($stdout); $stdout = trim($stdout);
@ -67,9 +64,8 @@ final class DiffusionGitBrowseQuery extends DiffusionBrowseQuery {
} }
list($stdout) = execx( list($stdout) = execx(
"(cd %s && %s ls-tree -l %s:%s)", "(cd %s && git ls-tree -l %s:%s)",
$local_path, $local_path,
$git,
$commit, $commit,
$path); $path);

View file

@ -9,7 +9,6 @@
phutil_require_module('phabricator', 'applications/differential/constants/changetype'); phutil_require_module('phabricator', 'applications/differential/constants/changetype');
phutil_require_module('phabricator', 'applications/diffusion/data/repositorypath'); phutil_require_module('phabricator', 'applications/diffusion/data/repositorypath');
phutil_require_module('phabricator', 'applications/diffusion/query/browse/base'); 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', 'future/exec');
phutil_require_module('phutil', 'utils'); phutil_require_module('phutil', 'utils');

View file

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

View file

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

View file

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