summaryrefslogtreecommitdiff
path: root/tests/diff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-03-14 13:20:51 -0700
committerRussell Belfer <rb@github.com>2014-04-17 14:43:45 -0700
commit8a2834d34173220c56bd1898397c0e6d200f327d (patch)
tree62d91bb19bc017a7bb5eb829bf2e52f04581d98c /tests/diff
parent40ed499039f887ebcb0b5badf0157519148398b8 (diff)
downloadlibgit2-8a2834d34173220c56bd1898397c0e6d200f327d.tar.gz
Index locking and entry allocation changes
This makes the lock management on the index a little bit broader, having a number of routines hold the lock across looking up the item to be modified and actually making the modification. Still not true thread safety, but more pure index modifications are now safe which allows the simple cases (such as starting up a diff while index modifications are underway) safe enough to get the snapshot without hitting allocation problems. As part of this, I simplified the allocation of index entries to use a flex array and just put the path at the end of the index entry. This makes every entry self-contained and makes it a little easier to feel sure that pointers to strings aren't being accidentally copied and freed while other references are still being held.
Diffstat (limited to 'tests/diff')
-rw-r--r--tests/diff/iterator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/diff/iterator.c b/tests/diff/iterator.c
index 19a9a0077..cdc64eb1d 100644
--- a/tests/diff/iterator.c
+++ b/tests/diff/iterator.c
@@ -363,9 +363,8 @@ static void index_iterator_test(
git_index *index;
git_iterator *i;
const git_index_entry *entry;
- int error, count = 0;
+ int error, count = 0, caps;
git_repository *repo = cl_git_sandbox_init(sandbox);
- unsigned int caps;
cl_git_pass(git_repository_index(&index, repo));
caps = git_index_caps(index);