Fix CI workflow and hook validation
This commit is contained in:
15
src/hooks.py
15
src/hooks.py
@@ -1,5 +1,3 @@
|
|||||||
"""Git hook integration for prepare-commit-msg."""
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
@@ -87,6 +85,19 @@ exec commit-gen hook "$@"
|
|||||||
try:
|
try:
|
||||||
hook_path = self.get_hook_path()
|
hook_path = self.get_hook_path()
|
||||||
|
|
||||||
|
if not self.repo_path.exists():
|
||||||
|
return HookResult(
|
||||||
|
success=False,
|
||||||
|
message=f"Repository path does not exist: {self.repo_path}"
|
||||||
|
)
|
||||||
|
|
||||||
|
git_dir = self.repo_path / ".git"
|
||||||
|
if not git_dir.exists():
|
||||||
|
return HookResult(
|
||||||
|
success=False,
|
||||||
|
message=f"Git directory not found: {git_dir}. Are you in a git repository?"
|
||||||
|
)
|
||||||
|
|
||||||
if not self.hooks_dir.exists():
|
if not self.hooks_dir.exists():
|
||||||
return HookResult(
|
return HookResult(
|
||||||
success=False,
|
success=False,
|
||||||
|
|||||||
Reference in New Issue
Block a user