1package hooks
2
3import (
4 "context"
5 "io"
6)
7
8// HookArg is an argument to a git hook.
9type HookArg struct {
10 OldSha string
11 NewSha string
12 RefName string
13}
14
15// Hooks provides an interface for git server-side hooks.
16type Hooks interface {
17 PreReceive(ctx context.Context, stdout io.Writer, stderr io.Writer, repo string, args []HookArg)
18 Update(ctx context.Context, stdout io.Writer, stderr io.Writer, repo string, arg HookArg)
19 PostReceive(ctx context.Context, stdout io.Writer, stderr io.Writer, repo string, args []HookArg)
20 PostUpdate(ctx context.Context, stdout io.Writer, stderr io.Writer, repo string, args ...string)
21}