I found an error log from Apache 2 that is fatal:
unsafe repository ('/home/repon' is owned by someone else)
It happens because I have git rev-parse --symbolic-full-name --abbrev-ref HEAD' in PHP code, and it looks like the new Git safety change no longer allows www-data to run this Git command.
Running the following command does not work:
git config --global --add safe.directory /homerepon
Is there a workaround to solve this issue?
Git version: 2.35.3
PHP version: 7.4
Apache2 version: 2.4.41
