Skip to content

Commit ce4efee

Browse files
authored
Merge pull request #225 from roman/rgonzalez/fix/allow-pre-commit-on-subdir
fix: allow .git directory on parent directory
2 parents 8539119 + 3973f37 commit ce4efee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/pre-commit.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ 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 [[ ! -e .git ]]; then
369+
elif ! ${git}/bin/git rev-parse --git-dir &> /dev/null; then
370370
echo 1>&2 "WARNING: pre-commit-hooks.nix: .git not found; skipping installation."
371371
else
372372
# These update procedures compare before they write, to avoid

0 commit comments

Comments
 (0)