Install: a long list of untracked files doesn't abort the install

With pipefail, head closing the pipe early made git's SIGPIPE fail the
assignment under set -e.
This commit is contained in:
Pierre Kisters committed 2026-10-01 04:10:04 +02:00
1 parent 04023a72d9
commit 1dd5df3d8b
1 file changed
+2 -1
+2 -1
View File
@@ -345,7 +345,8 @@ cmd_install() {
if [[ -n $dir ]] && git -C "$dir" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local untracked
untracked="$(git -C "$dir" ls-files --others --exclude-standard -- '*.nix' | head -n5)"
# || true: with pipefail, head closing the pipe early fails git.
untracked="$(git -C "$dir" ls-files --others --exclude-standard -- '*.nix' | head -n5 || true)"
[[ -z $untracked ]] || warn "untracked files are invisible to the flake (git add them): $(echo "$untracked" | tr '\n' ' ')"
fi