summaryrefslogtreecommitdiff
path: root/tag.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-07-03 08:37:23 +0200
committerCarlos Martín Nieto <[email protected]>2014-07-03 08:37:23 +0200
commitd117fc9aa8b727a59fbdf7b1aa3bd87c60331b6a (patch)
tree834ec9e204148ca901b7daef3c9af9dfbbb3a922 /tag.go
parentae5efcda9be2054734cdc3399a85e6f2ddceacff (diff)
parentb3306bee412e29558ac334d2a4bbc0be7d85e2d5 (diff)
Merge commit 'refs/pull/95/head' of github.com:libgit2/git2go
Diffstat (limited to 'tag.go')
-rw-r--r--tag.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/tag.go b/tag.go
new file mode 100644
index 0000000..89ac8bd
--- /dev/null
+++ b/tag.go
@@ -0,0 +1,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))
+}