Skip to content

Commit 0c9555d

Browse files
authored
Merge pull request #190 from cachix/skip-if-not-git-repo
skip installation if there's no .git
2 parents f66b4ab + a6fc3ff commit 0c9555d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/pre-commit.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ in
366366
if ! type -t git >/dev/null; then
367367
# This happens in pure shells, including lorri
368368
echo 1>&2 "WARNING: pre-commit-hooks.nix: git command not found; skipping installation."
369+
elif [[ ! -f .git ]]; then
370+
echo 1>&2 "WARNING: pre-commit-hooks.nix: .git not found; skipping installation."
369371
else
370372
# These update procedures compare before they write, to avoid
371373
# filesystem churn. This improves performance with watch tools like lorri

0 commit comments

Comments
 (0)