Steps to reproduce:
- PHP 8.2.7; Phorge at 108cbcd09bd39fda0ad24a2ee25afe5aac230e08
- Check that http://phorge.localhost/config/edit/repository.default-local-path/ is set to default /var/repo/
- Make sure that /var/repo/ exists locally
- As a Phorge admin, go to Diffusion at http://phorge.localhost/diffusion/
- Select in upper right corner to go to http://phorge.localhost/diffusion/edit/form/default/
- Select "Create Git Repository" to go to http://phorge.localhost/diffusion/edit/form/default/?vcs=git
- On the Create Repository page, in the Name field, enter gitRepoEmpty
- Select the Create Repository button
- End up on http://phorge.localhost/diffusion/19/manage/
- Select in the left panel (while no directory exists for this code repository)
- Wait a minute for daemons to create the repository
- In a terminal, go to now existing /var/repo/19/
- In a terminal, run git init
- In a terminal, run git checkout -b master
- In a terminal, run touch newFile
- In a terminal, run git add newFile
- In a terminal, run git commit -m "first commit" newFile
- In the browser, on http://phorge.localhost/diffusion/19/manage/ , select on the right and select Schedule Update button
- In the browser, go to http://phorge.localhost/diffusion/19/
- Select the Tags tab to go to http://phorge.localhost/diffusion/19/tags/master/
[2023-06-12 00:00:04] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261] arcanist(head=diffusionEmptyRepoPatternSearch, ref.master=97e163187418, ref.diffusionEmptyRepoPatternSearch=97e163187418), phorge(head=master, ref.master=108cbcd09bd3) #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/diffusion/controller/DiffusionTagListController.php:28] #1 <#2> DiffusionTagListController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284] #2 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41] #3 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751] #4 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296] #5 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203] #6 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
After fixing, get the expected CommandException: Command failed with error #128! due to fatal: detected dubious ownership in repository at '/var/repo/19' (plus a RuntimeException: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated as a bonus).