@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve error message if local Git working copy directory exists but isn't a working copy

Summary: Fixes T9701. I don't want to try to autofix this because destroying the directory could destroy important files, but we can improve the error message.

Test Plan: Faked a failure, ran `repository update X`, got a more tailored error message.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9701

Differential Revision: https://secure.phabricator.com/D14971

+15 -2
+15 -2
src/applications/repository/engine/PhabricatorRepositoryEngine.php
··· 62 62 * @return void 63 63 */ 64 64 protected function verifyGitOrigin(PhabricatorRepository $repository) { 65 - list($remotes) = $repository->execxLocalCommand( 66 - 'remote show -n origin'); 65 + try { 66 + list($remotes) = $repository->execxLocalCommand( 67 + 'remote show -n origin'); 68 + } catch (CommandException $ex) { 69 + throw new PhutilProxyException( 70 + pht( 71 + 'Expected to find a Git working copy at path "%s", but the '. 72 + 'path exists and is not a valid working copy. If you remove '. 73 + 'this directory, the daemons will automatically recreate it '. 74 + 'correctly. Phabricator will not destroy the directory for you '. 75 + 'because it can not be sure that it does not contain important '. 76 + 'data.', 77 + $repository->getLocalPath()), 78 + $ex); 79 + } 67 80 68 81 $matches = null; 69 82 if (!preg_match('/^\s*Fetch URL:\s*(.*?)\s*$/m', $remotes, $matches)) {