summaryrefslogtreecommitdiff
path: root/Documentation/config/safe.txt
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2022-07-14 21:28:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-07-14 22:08:29 (GMT)
commit6061601d9f1f1c95da5f9304c319218f7cc3ec75 (patch)
tree34511fef78126c405e81fbc6d170f672ae4505ab /Documentation/config/safe.txt
parent5b3c650777547f2274540a036da641651fb866b0 (diff)
downloadgit-6061601d9f1f1c95da5f9304c319218f7cc3ec75.zip
git-6061601d9f1f1c95da5f9304c319218f7cc3ec75.tar.gz
git-6061601d9f1f1c95da5f9304c319218f7cc3ec75.tar.bz2
safe.directory: use git_protected_config()
Use git_protected_config() to read `safe.directory` instead of read_very_early_config(), making it 'protected configuration only'. As a result, `safe.directory` now respects "-c", so update the tests and docs accordingly. It used to ignore "-c" due to how it was implemented, not because of security or correctness concerns [1]. [1] https://lore.kernel.org/git/xmqqlevabcsu.fsf@gitster.g/ Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config/safe.txt')
-rw-r--r--Documentation/config/safe.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/config/safe.txt b/Documentation/config/safe.txt
index fa02f3c..f72b440 100644
--- a/Documentation/config/safe.txt
+++ b/Documentation/config/safe.txt
@@ -12,9 +12,9 @@ via `git config --add`. To reset the list of safe directories (e.g. to
override any such directories specified in the system config), add a
`safe.directory` entry with an empty value.
+
-This config setting is only respected when specified in a system or global
-config, not when it is specified in a repository config, via the command
-line option `-c safe.directory=<path>`, or in environment variables.
+This config setting is only respected in protected configuration (see
+<<SCOPES>>). This prevents the untrusted repository from tampering with this
+value.
+
The value of this setting is interpolated, i.e. `~/<path>` expands to a
path relative to the home directory and `%(prefix)/<path>` expands to a