summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hooks.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/hooks.py b/hooks.py
index fc31a5ef..d6e1e3bb 100644
--- a/hooks.py
+++ b/hooks.py
@@ -101,12 +101,11 @@ class RepoHook:
101 self._abort_if_user_denies = abort_if_user_denies 101 self._abort_if_user_denies = abort_if_user_denies
102 102
103 # Store the full path to the script for convenience. 103 # Store the full path to the script for convenience.
104 if self._hooks_project: 104 self._script_fullpath = None
105 if self._hooks_project and self._hooks_project.worktree:
105 self._script_fullpath = os.path.join( 106 self._script_fullpath = os.path.join(
106 self._hooks_project.worktree, self._hook_type + ".py" 107 self._hooks_project.worktree, self._hook_type + ".py"
107 ) 108 )
108 else:
109 self._script_fullpath = None
110 109
111 def _GetHash(self): 110 def _GetHash(self):
112 """Return a hash of the contents of the hooks directory. 111 """Return a hash of the contents of the hooks directory.
@@ -443,6 +442,7 @@ class RepoHook:
443 if ( 442 if (
444 self._bypass_hooks 443 self._bypass_hooks
445 or not self._hooks_project 444 or not self._hooks_project
445 or not self._script_fullpath
446 or self._hook_type not in self._hooks_project.enabled_repo_hooks 446 or self._hook_type not in self._hooks_project.enabled_repo_hooks
447 ): 447 ):
448 return True 448 return True