summaryrefslogtreecommitdiff
path: root/git/test/test_index.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/test/test_index.py')
-rw-r--r--git/test/test_index.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py
index ffc4bffe..a928fe5e 100644
--- a/git/test/test_index.py
+++ b/git/test/test_index.py
@@ -690,6 +690,9 @@ class TestIndex(TestBase):
index.add(files, write=True)
if os.name != 'nt':
hp = hook_path('pre-commit', index.repo.git_dir)
+ hpd = os.path.dirname(hp)
+ if not os.path.isdir(hpd):
+ os.mkdir(hpd)
with open(hp, "wt") as fp:
fp.write("#!/usr/bin/env sh\necho stdout; echo stderr 1>&2; exit 1")
# end