Commit 220d6f8a104661ae9edc4f96cd8f520ef4c4dc1d

Edward Thomson 2015-09-11T20:06:14

mempack: expose clear function

diff --git a/src/odb_mempack.c b/src/odb_mempack.c
index 25f3059..594a278 100644
--- a/src/odb_mempack.c
+++ b/src/odb_mempack.c
@@ -155,17 +155,14 @@ void git_mempack_reset(git_odb_backend *_backend)
 
 	git_array_clear(db->commits);
 
-	git_oidmap_free(db->objects);
-	db->objects = git_oidmap_alloc();
+	git_oidmap_clear(db->objects);
 }
 
 static void impl__free(git_odb_backend *_backend)
 {
 	struct memory_packer_db *db = (struct memory_packer_db *)_backend;
 
-	git_mempack_reset(db);
 	git_oidmap_free(db->objects);
-
 	git__free(db);
 }
 
diff --git a/src/oidmap.h b/src/oidmap.h
index d2c451e..2cf208f 100644
--- a/src/oidmap.h
+++ b/src/oidmap.h
@@ -49,4 +49,6 @@ GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
 
 #define git_oidmap_size(h) kh_size(h)
 
+#define git_oidmap_clear(h) kh_clear(oid, h)
+
 #endif