/
tag_custom.go
31 lines (27 loc) · 945 Bytes
/
tag_custom.go
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
package tag
import "github.com/ldez/go-git-cmd-wrapper/v2/types"
// Name [<tagname>]
// The name of the tag to create, delete, or describe.
// The new tag name must pass all checks defined by git-check-ref-format(1).
// Some of these checks may restrict the characters allowed in a tag name.
func Name(tagName string) func(*types.Cmd) {
return func(g *types.Cmd) {
g.AddOptions(tagName)
}
}
// Commit <commit>, <object>
// The object that the new tag will refer to, usually a commit. Defaults to HEAD.
func Commit(commit string) func(*types.Cmd) {
return func(g *types.Cmd) {
g.AddOptions(commit)
}
}
// Format <format>
// A string that interpolates %(fieldname) from a tag ref being shown and the object it points at.
// The format is the same as that of git-for-each-ref(1).
// When unspecified, defaults to %(refname:strip=2).
func Format(format string) func(*types.Cmd) {
return func(g *types.Cmd) {
g.AddOptions(format)
}
}