MCPcopy Create free account
hub / github.com/brimdata/super / ParseCommitish

Function ParseCommitish

dbid/head.go:14–25  ·  view source on GitHub ↗
(commitish string)

Source from the content-addressed store, hash-verified

12}
13
14func ParseCommitish(commitish string) (*Commitish, error) {
15 if commitish == "" {
16 return nil, errors.New("empty pool and branch")
17 }
18 if strings.IndexByte(commitish, '\'') >= 0 {
19 return nil, errors.New("pool and branch names may not contain single quote characters")
20 }
21 if i := strings.LastIndexByte(commitish, '@'); i > -1 {
22 return &Commitish{Pool: commitish[:i], Branch: commitish[i+1:]}, nil
23 }
24 return &Commitish{Pool: commitish}, nil
25}
26
27var ErrNoPool = errors.New("no pool")
28

Callers 2

HEADMethod · 0.92
RunMethod · 0.92

Calls 1

NewMethod · 0.80

Tested by

no test coverage detected