Skip to content

Conversation

@umlaeute
Copy link

@umlaeute umlaeute commented Mar 7, 2023

The assumption that we can put a file into .git/hooks/ if .git exists is wrong, e.g. if .git is a file (as is the case when using git submodule).

This PR fixes the issue by checking if .git/hooks/ exists instead:

  • the trailing slash checks for directories (or: directory-likes) rather than for mere existence (regardless of type)
  • since we want to put the target file into the hooks/ subdirectory we just check for that (just in case the .git directory is weird)

Closes: #603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHooks does not handle running in submodules

1 participant