(event string)
| 49 | t.Fatalf("parse settings: %v\nraw: %s", err, raw) |
| 50 | } |
| 51 | return m |
| 52 | } |
| 53 | |
| 54 | func hookEventReferencesCommand(hooks map[string]any, event, command string) bool { |
| 55 | entries, _ := hooks[event].([]any) |
| 56 | return countMatchingHookEntries(entries, command) >= 1 |
| 57 | } |
| 58 | |
| 59 | func countMatchingHookEntries(entries []any, command string) int { |
| 60 | n := 0 |
| 61 | for _, entry := range entries { |
| 62 | m, ok := entry.(map[string]any) |
no outgoing calls
no test coverage detected