From 12311c8528c577ebb11006f24c026c7a4d2f2de3 Mon Sep 17 00:00:00 2001 From: Calin Seciu Date: Fri, 31 Jul 2015 09:51:19 +0200 Subject: [PATCH] Add TagsCollection --- repository.go | 4 ++++ tag.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/repository.go b/repository.go index 44509af..b17745d 100644 --- a/repository.go +++ b/repository.go @@ -27,6 +27,9 @@ type Repository struct { // Notes represents the collection of notes and can be used to // read, write and delete notes from this repository. Notes NoteCollection + // Tags represents the collection of tags and can be used to create, + // list and iterate tags in this repository. + Tags TagsCollection } func newRepositoryFromC(ptr *C.git_repository) *Repository { @@ -36,6 +39,7 @@ func newRepositoryFromC(ptr *C.git_repository) *Repository { repo.Submodules.repo = repo repo.References.repo = repo repo.Notes.repo = repo + repo.Tags.repo = repo runtime.SetFinalizer(repo, (*Repository).Free) diff --git a/tag.go b/tag.go index 89ac8bd..74b18d8 100644 --- a/tag.go +++ b/tag.go @@ -42,3 +42,7 @@ func (t Tag) TargetId() *Oid { func (t Tag) TargetType() ObjectType { return ObjectType(C.git_tag_target_type(t.cast_ptr)) } + +type TagsCollection struct { + repo *Repository +}