@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.

Config: Fix git errors when .git does not exist

Summary: Bug: T16023

Test Plan: Delete `.git` and visit `/config/`

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16023

Differential Revision: https://we.phorge.it/D25931

xtex a81f20e0 06a62b34

+11 -3
+11 -3
src/applications/config/controller/PhabricatorConfigConsoleController.php
··· 367 367 $lib, 368 368 'https://we.phorge.it/T15282', 369 369 $lib_root)); 370 - } else { 370 + return; 371 + } 371 372 372 - // Otherwise show a generic error message 373 - phlog($e); 373 + // Second, detect if .git does not exist 374 + // https://we.phorge.it/T16023 375 + $expected_error_msg_part = 'fatal: not a git repository '. 376 + '(or any of the parent directories): .git'; 377 + if (strpos($stderr, $expected_error_msg_part) !== false) { 378 + return; 374 379 } 380 + 381 + // Otherwise show a generic error message 382 + phlog($e); 375 383 } 376 384 377 385 }