summaryrefslogtreecommitdiff
path: root/reference.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2013-06-17 02:08:13 +0200
committerCarlos Martín Nieto <[email protected]>2013-06-17 02:08:13 +0200
commitf5fc7e5f784348b469eb8d2125af75b6b4b0d14e (patch)
treecb17c4c270a1030582595217c461e1f9c152a88f /reference.go
parenta33875f9c5479b8bb78835b630ce60507c70f2a8 (diff)
Reference: adjust to iterator changes
The Library's iterators now can return either the reference or the reference's name. As the name is what we're set up for, rename the functions appropriately so we compile against altest development.
Diffstat (limited to 'reference.go')
-rw-r--r--reference.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/reference.go b/reference.go
index 93ab7de..5aee276 100644
--- a/reference.go
+++ b/reference.go
@@ -149,9 +149,9 @@ func (repo *Repository) NewReferenceIteratorGlob(glob string) (*ReferenceIterato
// Next retrieves the next reference name. If the iteration is over,
// the returned error is git.ErrIterOver
-func (v *ReferenceIterator) Next() (string, error) {
+func (v *ReferenceIterator) NextName() (string, error) {
var ptr *C.char
- ret := C.git_reference_next(&ptr, v.ptr)
+ ret := C.git_reference_next_name(&ptr, v.ptr)
if ret == ITEROVER {
return "", ErrIterOver
}
@@ -163,16 +163,16 @@ func (v *ReferenceIterator) Next() (string, error) {
}
// Create a channel from the iterator. You can use range on the
-// returned channel to iterate over all the references. The channel
+// returned channel to iterate over all the references names. The channel
// will be closed in case any error is found.
-func (v *ReferenceIterator) Iter() <-chan string {
+func (v *ReferenceIterator) NameIter() <-chan string {
ch := make(chan string)
go func() {
defer close(ch)
- name, err := v.Next()
+ name, err := v.NextName()
for err == nil {
ch <- name
- name, err = v.Next()
+ name, err = v.NextName()
}
}()