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>2014-02-08 02:10:35 +0400
committerRussell Belfer <rb@github.com>2014-04-18 01:43:45 +0400
commit3dbee456564a9baf24631bfe219f81434d8fdfa6 (patch)
treec9291c06be39e6c3e576589c34a84f70c1499cd2 /src/iterator.c
parentc67fd4c9d5e1ff715df28b884d7f7f9f20fad1ec (diff)
Some index internals refactoring
Again, laying groundwork for some index iterator changes, this contains a bunch of code refactorings for index internals that should make it easier down the line to add locking around index modifications. Also this removes the redundant prefix_position function and fixes some potential memory leaks.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/iterator.c b/src/iterator.c
index a7a44914c..45655254c 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -815,8 +815,10 @@ static int index_iterator__reset(
if (iterator__reset_range(self, start, end) < 0)
return -1;
- ii->current = ii->base.start ?
- git_index__prefix_position(ii->index, ii->base.start) : 0;
+ ii->current = 0;
+
+ if (ii->base.start)
+ git_index__find(&ii->current, ii->index, ii->base.start, 0, 0);
if ((ie = index_iterator__skip_conflicts(ii)) == NULL)
return 0;