Skip to content

Commit

Permalink
Handle empty config hook section
Browse files Browse the repository at this point in the history
  • Loading branch information
yalosev committed Oct 20, 2023
1 parent b11ea6b commit 991ca50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/hook/hook_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ func (hm *hookManager) loadHook(hookPath string) (hook *Hook, err error) {
hook.WithHookController(hookCtrl)
hook.WithTmpDir(hm.TempDir())

if hook.Config == nil {
return nil, fmt.Errorf("hook %q is marked as executable but doesn't contain config section", hook.Path)
}

hookEntry.Infof("Loaded config: %s", hook.GetConfigDescription())

return hook, nil
Expand Down

0 comments on commit 991ca50

Please sign in to comment.