Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F85685
pathenv.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
epriestley
Nov 28 2013, 4:55 AM
2013-11-28 04:55:34 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
pathenv.diff
View Options
diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
index e5ec3bb..5f75264 100644
--- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
@@ -287,6 +287,23 @@ final class PhabricatorRepositoryPullEngine
* @task git
*/
private function installGitHook() {
+ $repository = $this->getRepository();
+ $path = $repository->getLocalPath();
+
+ if ($repository->isWorkingCopyBare()) {
+ $path .= '/hooks/pre-receive';
+ } else {
+ $path .= '/.git/hooks/pre-receive';
+ }
+
+ $root = dirname(phutil_get_library_root('phabricator'));
+ $bin = $root.'/bin/commit-hook';
+
+ $hook = "#!/bin/sh\n".
+ "exec {$bin} {$callsign}\n";
+
+ $this->installHook($path, $hook);
+ }
/* -( Pulling Mercurial Working Copies )----------------------------------- */
diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php
index 44a43e6..f4882c0 100644
--- a/src/infrastructure/env/PhabricatorEnv.php
+++ b/src/infrastructure/env/PhabricatorEnv.php
@@ -108,6 +108,10 @@ final class PhabricatorEnv {
}
putenv('PATH='.$env_path);
+ // Write this back into $_ENV, too, so ExecFuture picks it up when creating
+ // subprocess environments.
+ $_ENV['PATH'] = $env_path;
+
PhabricatorEventEngine::initialize();
$translation = PhabricatorEnv::newObjectFromConfig('translation.provider');
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/zx/jm/ikbc5n3kgafcgqu2
Default Alt Text
pathenv.diff (1 KB)
Attached To
Mode
P1010 pathenv.diff
Attached
Detach File
Event Timeline
Log In to Comment