From 94165a1fda287f0b1b4aa3d2b87f6fdbd01ec240 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 17:26:46 +0000 Subject: [PATCH] Fix CI workflow and hook validation --- src/hooks.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/hooks.py b/src/hooks.py index 5acf075..5130fa2 100644 --- a/src/hooks.py +++ b/src/hooks.py @@ -1,5 +1,3 @@ -"""Git hook integration for prepare-commit-msg.""" - import os import shutil from dataclasses import dataclass @@ -87,6 +85,19 @@ exec commit-gen hook "$@" try: 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(): return HookResult( success=False,