forked from libgit2/git2go
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtag.go
44 lines (34 loc) · 737 Bytes
/
tag.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
32
33
34
35
36
37
38
39
40
41
42
43
44
package git
/*
#include <git2.h>
*/
import "C"
// Tag
type Tag struct {
gitObject
cast_ptr *C.git_tag
}
func (t Tag) Message() string {
return C.GoString(C.git_tag_message(t.cast_ptr))
}
func (t Tag) Name() string {
return C.GoString(C.git_tag_name(t.cast_ptr))
}
func (t Tag) Tagger() *Signature {
cast_ptr := C.git_tag_tagger(t.cast_ptr)
return newSignatureFromC(cast_ptr)
}
func (t Tag) Target() Object {
var ptr *C.git_object
ret := C.git_tag_target(&ptr, t.cast_ptr)
if ret != 0 {
return nil
}
return allocObject(ptr, t.repo)
}
func (t Tag) TargetId() *Oid {
return newOidFromC(C.git_tag_target_id(t.cast_ptr))
}
func (t Tag) TargetType() ObjectType {
return ObjectType(C.git_tag_target_type(t.cast_ptr))
}