fix execution in worktrees in subdirectories of bare repositories

This commit is contained in:
Anthony Sottile 2021-01-27 10:08:48 -08:00
parent 7727f8777a
commit f75fc6b2a8
3 changed files with 21 additions and 6 deletions

View file

@ -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.',