Address review feedback about Windows hook paths · gitpython-developers/GitPython@0702dea · GitHub
Skip to content

Commit 0702dea

Browse files
codexByron
authored andcommitted
Address review feedback about Windows hook paths
Review feedback: core.hooksPath can point outside index.repo.working_dir, where Path.relative_to() raises on Windows and prevents a valid hook from running. Build the Bash argument with os.path.relpath so hooks in parent or other absolute locations remain executable. Fall back to the absolute POSIX-form path when Windows cannot form a relative path across drives, and add a focused command-construction regression test.
1 parent 6bdeff8 commit 0702dea

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

git/index/fun.py

Lines changed: 8 additions & 2 deletions

test/test_index.py

Lines changed: 17 additions & 0 deletions

0 commit comments

Comments
 (0)