Monorepo for Tangled
0

Configure Feed

Select the types of activity you want to include in your feed.

at master 471 B View raw
1package types 2 3import ( 4 "fmt" 5 6 "github.com/bluekeyes/go-gitdiff/gitdiff" 7) 8 9type FormatPatch struct { 10 Files []*gitdiff.File 11 *gitdiff.PatchHeader 12 Raw string 13} 14 15func (f FormatPatch) ChangeId() (string, error) { 16 if vals, ok := f.RawHeaders["Change-Id"]; ok && len(vals) == 1 { 17 return vals[0], nil 18 } 19 return "", fmt.Errorf("no change-id found") 20} 21 22func (f FormatPatch) ChangeIdOrEmpty() string { 23 id, err := f.ChangeId() 24 if err != nil { 25 return "" 26 } 27 return id 28}