File: filter_process_status.go

package info (click to toggle)
git-lfs 2.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,384 kB
  • sloc: sh: 16,421; makefile: 418; ruby: 100
file content (33 lines) | stat: -rw-r--r-- 886 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package git

import "fmt"

// FilterProcessStatus is a constant type representing the various valid
// responses for `status=` in the Git filtering process protocol.
type FilterProcessStatus uint8

const (
	// StatusSuccess is a valid response when a successful event has
	// occurred.
	StatusSuccess FilterProcessStatus = iota + 1
	// StatusDelay is a valid response when a delay has occurred.
	StatusDelay
	// StatusError is a valid response when an error has occurred.
	StatusError
)

// String implements fmt.Stringer by returning a protocol-compliant
// representation of the receiving status, or panic()-ing if the Status is
// unknown.
func (s FilterProcessStatus) String() string {
	switch s {
	case StatusSuccess:
		return "success"
	case StatusDelay:
		return "delayed"
	case StatusError:
		return "error"
	}

	panic(fmt.Sprintf("git: unknown FilterProcessStatus '%d'", s))
}