mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
fix execution in worktrees in subdirectories of bare repositories
This commit is contained in:
parent
7727f8777a
commit
f75fc6b2a8
3 changed files with 21 additions and 6 deletions
|
|
@ -61,7 +61,7 @@ def get_root() -> str:
|
|||
'git failed. Is it installed, and are you in a Git repository '
|
||||
'directory?',
|
||||
)
|
||||
if os.path.commonpath((root, git_dir)) == git_dir:
|
||||
if os.path.samefile(root, git_dir):
|
||||
raise FatalError(
|
||||
'git toplevel unexpectedly empty! make sure you are not '
|
||||
'inside the `.git` directory of your repository.',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue