'safe.directory' setting ignored for some operations?
- From
- Nikolaus Rath <nikolaus@quadrature.ai>
- Date
- Apr 10, 2025, 13:21 UTC
- Message-ID
- <CAPzgaL1NH_GofMko6f2Auz4e1TjTJNH0w4-ph8np04QRfT_R7A@mail.gmail.com>
- In-Reply-To
- <CAPzgaL2Q4v0LMSek=osugTDCDww9D-Tg+tDsFhFvRSVXFR8g6Q@mail.gmail.com>
Hello,
It seems to me that the 'safe.directory = *' option is ignored for some operations:
---snip-- $ git --version git version 2.43.0
$ git config --get-all --show-scope safe.directory command *
$ git status -v --untracked=all --ignored HEAD detached at e116555 [...] nothing to commit, working tree clean
$ git clone -v --no-checkout -- /builds/coreinfra/grafana_terraform/.git /builds/coreinfra/grafana_terraform/tmpus18hzbs Cloning into '/builds/coreinfra/grafana_terraform/tmpus18hzbs'... fatal: detected dubious ownership in repository at '/builds/coreinfra/grafana_terraform/.git' To add an exception for this directory, call:
git config --global --add safe.directory /builds/coreinfra/grafana_terraform/.git fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. ---snip--
Is this a known issue, or working as intended?
(Without setting safe.directory, both `git status` and `git clone` fail as expected).
Best, -Nikolaus
-- nikolaus@quadrature.ai https://quadrature.ai Dir: +44-20-8145-4726 Main: +44-20-3743-0400 The Leadenhall Building, 122 Leadenhall Street, London, EC3V 4AB