File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1154,9 +1154,9 @@ def test_run_commit_hook_respects_core_hookspath_bare_repo(self, rw_repo):
11541154 """
11551155 index = rw_repo .index
11561156
1157- # Create a custom hooks directory (use absolute path for bare repo)
1158- # Use a unique name based on the repo to avoid conflicts
1159- custom_hooks_dir = Path (rw_repo .git_dir ). parent / "bare- custom-hooks"
1157+ # Create a custom hooks directory inside the git_dir for bare repo
1158+ # This ensures the path is relative to working_dir (which equals git_dir for bare repos)
1159+ custom_hooks_dir = Path (rw_repo .git_dir ) / "custom-hooks"
11601160 custom_hooks_dir .mkdir (exist_ok = True )
11611161
11621162 # Create a hook in the custom location
@@ -1171,7 +1171,7 @@ def test_run_commit_hook_respects_core_hookspath_bare_repo(self, rw_repo):
11711171 # Run the hook - it should use the custom path
11721172 run_commit_hook ("fake-hook" , index )
11731173
1174- # Output goes to cwd, which for bare repos during hook execution is git_dir
1174+ # Output goes to cwd, which for bare repos during hook execution is working_dir (same as git_dir)
11751175 output_file = Path (rw_repo .git_dir ) / "output.txt"
11761176 self .assertTrue (output_file .exists (), "Hook should have created output.txt" )
11771177 output = output_file .read_text (encoding = "utf-8" )
You can’t perform that action at this time.
0 commit comments