summaryrefslogtreecommitdiff
path: root/src/vector.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-01 10:22:51 -0700
committerRussell Belfer <rb@github.com>2014-04-01 10:22:51 -0700
commitaa78c9ba778d8c7c2c62f875b974ae53ba90d12b (patch)
tree69670c85b09a7e2d32e178c03a099fca508034a5 /src/vector.c
parenteeeb9654f064e1047ef8f3cb5a38636133426cdd (diff)
downloadlibgit2-aa78c9ba778d8c7c2c62f875b974ae53ba90d12b.tar.gz
Minor submodule cache locking improvements
This improvement the management of the lock around submodule cache updates slightly, using the lock to make sure that foreach can safely make a snapshot of all existing submodules and making sure that git_submodule_add_setup also grabs a lock before inserting the new submodule. Cache initialization / refresh should already have been holding the lock correctly as it adds submodules.
Diffstat (limited to 'src/vector.c')
-rw-r--r--src/vector.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vector.c b/src/vector.c
index e5d8919d3..c2c67e6b8 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -54,7 +54,7 @@ int git_vector_dup(git_vector *v, const git_vector *src, git_vector_cmp cmp)
bytes = src->length * sizeof(void *);
v->_alloc_size = src->length;
- v->_cmp = cmp;
+ v->_cmp = cmp ? cmp : src->_cmp;
v->length = src->length;
v->flags = src->flags;
if (cmp != src->_cmp)