discard string context of git config's core.excludesFile

Before this change, any store path in your git config would become part
of the string context of any of the parsed strings, and then prevent us
from appending it to a path.

Upon further reflection, we don't care even if core.excludesFile is a
store path itself, so we can unconditionally throw away the string
context.
This commit is contained in:
Taeer Bar-Yam 2025-08-14 10:32:35 -04:00
parent 637db32942
commit 61ddc300c1

View file

@ -242,7 +242,10 @@ rec {
for
(guard (toLower section == "core" && toLower key == "excludesfile"))
(_:
resolveFile (home /.) value
# SAFETY: Ultimately this path will get passed into
# `builtins.readFile`, which ignores the context anyways. The
# context is only relevant if it becomes part of a derivation.
resolveFile (home /.) (builtins.unsafeDiscardStringContext value)
)
)
);