git-compat-util: allow root to access both SUDO_UID and root owned
commit6b11e3d52e919cce91011f4f9025e6f4b61375f2
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Fri, 17 Jun 2022 20:23:38 +0000 (17 13:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jun 2022 21:03:08 +0000 (17 14:03 -0700)
tree54aeed97455b485cb22328e34d773e9794f10698
parentb9063afda17a2aa6310423c9f7b776c41f753091
git-compat-util: allow root to access both SUDO_UID and root owned

Previous changes introduced a regression which will prevent root for
accessing repositories owned by thyself if using sudo because SUDO_UID
takes precedence.

Loosen that restriction by allowing root to access repositories owned
by both uid by default and without having to add a safe.directory
exception.

A previous workaround that was documented in the tests is no longer
needed so it has been removed together with its specially crafted
prerequisite.

Helped-by: Johanness Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/safe.txt
git-compat-util.h
t/t0034-root-safe-directory.sh