diff --git a/modules/pre-commit.nix b/modules/pre-commit.nix index 83f7c3ed..a334fb02 100644 --- a/modules/pre-commit.nix +++ b/modules/pre-commit.nix @@ -366,7 +366,7 @@ in if ! type -t git >/dev/null; then # This happens in pure shells, including lorri echo 1>&2 "WARNING: pre-commit-hooks.nix: git command not found; skipping installation." - elif [[ ! -e .git ]]; then + elif ! ${git}/bin/git rev-parse --git-dir &> /dev/null; then echo 1>&2 "WARNING: pre-commit-hooks.nix: .git not found; skipping installation." else # These update procedures compare before they write, to avoid