Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-12-11 03:29:44 +0400
committerRussell Belfer <rb@github.com>2012-12-11 03:38:41 +0400
commit91e7d26303b17c7ebc45ba565247e968aaa20848 (patch)
treecb205e56dfcbf9dd4df6ed150f152106aa6da342 /src/iterator.h
parent9950d27ab62cc31a3ebf1944fd33dd65432be790 (diff)
Fix iterator reset and add reset ranges
The `git_iterator_reset` command has not been working in all cases particularly when there is a start and end range. This fixes it and adds tests for it, and also extends it with the ability to update the start/end range strings when an iterator is reset.
Diffstat (limited to 'src/iterator.h')
-rw-r--r--src/iterator.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/iterator.h b/src/iterator.h
index 07cce5a5a..9fe684412 100644
--- a/src/iterator.h
+++ b/src/iterator.h
@@ -37,7 +37,7 @@ struct git_iterator {
int (*at_end)(git_iterator *);
int (*advance)(git_iterator *, const git_index_entry **);
int (*seek)(git_iterator *, const char *prefix);
- int (*reset)(git_iterator *);
+ int (*reset)(git_iterator *, const char *start, const char *end);
void (*free)(git_iterator *);
};
@@ -126,9 +126,10 @@ GIT_INLINE(int) git_iterator_seek(
return iter->seek(iter, prefix);
}
-GIT_INLINE(int) git_iterator_reset(git_iterator *iter)
+GIT_INLINE(int) git_iterator_reset(
+ git_iterator *iter, const char *start, const char *end)
{
- return iter->reset(iter);
+ return iter->reset(iter, start, end);
}
GIT_INLINE(void) git_iterator_free(git_iterator *iter)