Switch to the Clay testing framework
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e149cd2..f61eeb1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,9 +119,9 @@
     ADD_DEFINITIONS(-DTEST_RESOURCES=\"${TEST_RESOURCES}\")
 
     INCLUDE_DIRECTORIES(tests)
-	FILE(GLOB SRC_TEST tests/t??-*.c)
+	FILE(GLOB SRC_TEST tests/*.c)
 
-	ADD_EXECUTABLE(libgit2_test tests/test_main.c tests/test_lib.c tests/test_helpers.c ${SRC} ${SRC_TEST} ${SRC_ZLIB})
+	ADD_EXECUTABLE(libgit2_test ${SRC} ${SRC_TEST} ${SRC_ZLIB})
 	TARGET_LINK_LIBRARIES(libgit2_test ${CMAKE_THREAD_LIBS_INIT})
 	IF (WIN32)
 		TARGET_LINK_LIBRARIES(libgit2_test ws2_32)
diff --git a/tests/NAMING b/tests/NAMING
deleted file mode 100644
index c2da016..0000000
--- a/tests/NAMING
+++ /dev/null
@@ -1,52 +0,0 @@
-Test sources should be named:
-
-  t????-function.c
-
-where ???? is a four digit code.  The first two digits classify
-the test into a major category; the final two digits indicate the
-sequence of the test within that category.  The function part of
-the test name should give a rough indication of what it does.
-
-Categories
-----------
-
-00__: Core library routines based only on the standard library,
-      and that are essential for everything else to run.  E.g.
-      errno and malloc.
-
-01__: Basic hashing functions, needed to handle the content
-      addressable store.
-
-02__: Basic object read access.
-
-03__: Basic object writing.
-
-04__: Parsing and loading commit data
-
-05__: Revision walking
-
-06__: Index reading, writing and searching
-
-07__: Tests for the internal hashtable code
-
-08__: Tag reading and writing
-
-09__: Reading tree objects
-
-10__: Symbolic, loose and packed references reading and writing.
-
-11__: SQLite backend
-
-12__: Repository init and opening
-
-13__: Threads, empty as of now
-
-14__: Redis backend
-
-15__: Configuration parsing
-
-16__: Remotes
-
-17__: Buffers
-
-18__: File Status
diff --git a/tests/clay.h b/tests/clay.h
new file mode 100644
index 0000000..fdcfc25
--- /dev/null
+++ b/tests/clay.h
@@ -0,0 +1,27 @@
+#ifndef __CLAY_TEST_H__
+#define __CLAY_TEST_H__
+
+#include <stdlib.h>
+
+void clay__assert(
+	int condition,
+	const char *file,
+	int line,
+	const char *error,
+	const char *description,
+	int should_abort);
+
+void clay_set_cleanup(void (*cleanup)(void *), void *opaque);
+
+#define clay_must_pass(expr, desc) clay__assert((expr) >= 0, __FILE__, __LINE__, "Function call failed: " #expr, desc, 1)
+#define clay_must_fail(expr, desc) clay__assert((expr) < 0, __FILE__, __LINE__, "Expected function call to fail: " #expr, desc, 1)
+#define clay_assert(expr, desc) clay__assert((expr) != 0, __FILE__, __LINE__, "Expression is not true: " #expr, desc, 1)
+
+#define clay_check_pass(expr, desc) clay__assert((expr) >= 0, __FILE__, __LINE__, "Function call failed: " #expr, desc, 0)
+#define clay_check_fail(expr, desc) clay__assert((expr) < 0, __FILE__, __LINE__, "Expected function call to fail: " #expr, desc, 0)
+#define clay_check(expr, desc) clay__assert((expr) != 0, __FILE__, __LINE__, "Expression is not true: " #expr, desc, 0)
+
+#define clay_fail(desc) clay__assert(0, __FILE__, __LINE__, "Test failed.", desc, 1)
+#define clay_warning(desc) clay__assert(0, __FILE__, __LINE__, "Warning during test execution:", desc, 0)
+
+#endif
diff --git a/tests/clay_libgit2.h b/tests/clay_libgit2.h
new file mode 100644
index 0000000..d8aa360
--- /dev/null
+++ b/tests/clay_libgit2.h
@@ -0,0 +1,12 @@
+#ifndef __CLAY_LIBGIT2__
+#define __CLAY_LIBGIT2__
+
+#include "clay.h"
+#include <git2.h>
+#include "common.h"
+
+#define must_be_true(expr) clay_assert(expr, NULL)
+#define must_pass(expr) clay_must_pass(expr, NULL)
+#define must_fail(expr) clay_must_fail(expr, NULL)
+
+#endif
diff --git a/tests/clay_main.c b/tests/clay_main.c
new file mode 100644
index 0000000..059b66e
--- /dev/null
+++ b/tests/clay_main.c
@@ -0,0 +1,509 @@
+
+/*
+ * Clay v0.3.0
+ *
+ * This is an autogenerated file. Do not modify.
+ * To add new unit tests or suites, regenerate the whole
+ * file with `./clay`
+ */
+
+#define clay_print(...) printf(__VA_ARGS__)
+
+#include <assert.h>
+#include <setjmp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+/* required for sandboxing */
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "clay.h"
+
+struct clay_error {
+	const char *test;
+	int test_number;
+	const char *suite;
+	const char *file;
+	int line_number;
+	const char *error_msg;
+	char *description;
+
+	struct clay_error *next;
+};
+
+static struct {
+	const char *active_test;
+	const char *active_suite;
+
+	int suite_errors;
+	int total_errors;
+
+	int test_count;
+
+	struct clay_error *errors;
+	struct clay_error *last_error;
+
+	void (*local_cleanup)(void *);
+	void *local_cleanup_payload;
+
+	jmp_buf trampoline;
+	int trampoline_enabled;
+} _clay;
+
+struct clay_func {
+	const char *name;
+	void (*ptr)(void);
+	size_t suite_n;
+};
+
+struct clay_suite {
+	const char *name;
+	struct clay_func initialize;
+	struct clay_func cleanup;
+	const struct clay_func *tests;
+	size_t test_count;
+};
+
+/* From clay_sandbox.c */
+static void clay_unsandbox(void);
+static int clay_sandbox(void);
+
+static void
+clay_run_test(
+	const struct clay_func *test,
+	const struct clay_func *initialize,
+	const struct clay_func *cleanup)
+{
+	int error_st = _clay.suite_errors;
+
+	_clay.trampoline_enabled = 1;
+
+	if (setjmp(_clay.trampoline) == 0) {
+		if (initialize->ptr != NULL)
+			initialize->ptr();
+
+		test->ptr();
+	}
+
+	_clay.trampoline_enabled = 0;
+
+	if (_clay.local_cleanup != NULL)
+		_clay.local_cleanup(_clay.local_cleanup_payload);
+
+	if (cleanup->ptr != NULL)
+		cleanup->ptr();
+
+	_clay.test_count++;
+
+	/* remove any local-set cleanup methods */
+	_clay.local_cleanup = NULL;
+	_clay.local_cleanup_payload = NULL;
+
+	clay_print("%c", (_clay.suite_errors > error_st) ? 'F' : '.');
+}
+
+static void
+clay_print_error(int num, const struct clay_error *error)
+{
+	clay_print("  %d) Failure:\n", num);
+
+	clay_print("%s::%s (%s) [%s:%d] [-t%d]\n",
+		error->suite,
+		error->test,
+		"no description",
+		error->file,
+		error->line_number,
+		error->test_number);
+
+	clay_print("  %s\n", error->error_msg);
+
+	if (error->description != NULL)
+		clay_print("  %s\n", error->description);
+
+	clay_print("\n");
+}
+
+static void
+clay_report_errors(void)
+{
+	int i = 1;
+	struct clay_error *error, *next;
+
+	error = _clay.errors;
+	while (error != NULL) {
+		next = error->next;
+		clay_print_error(i++, error);
+		free(error->description);
+		free(error);
+		error = next;
+	}
+}
+
+static void
+clay_run_suite(const struct clay_suite *suite)
+{
+	const struct clay_func *test = suite->tests;
+	size_t i;
+
+	_clay.active_suite = suite->name;
+	_clay.suite_errors = 0;
+
+	for (i = 0; i < suite->test_count; ++i) {
+		_clay.active_test = test[i].name;
+		clay_run_test(&test[i], &suite->initialize, &suite->cleanup);
+	}
+}
+
+static void
+clay_run_single(const struct clay_func *test,
+	const struct clay_suite *suite)
+{
+	_clay.suite_errors = 0;
+	_clay.active_suite = suite->name;
+	_clay.active_test = test->name;
+
+	clay_run_test(test, &suite->initialize, &suite->cleanup);
+}
+
+static int
+clay_usage(void)
+{
+	exit(-1);
+}
+
+static void
+clay_parse_args(
+	int argc, char **argv,
+	const struct clay_func *callbacks,
+	size_t cb_count,
+	const struct clay_suite *suites,
+	size_t suite_count)
+{
+	int i;
+
+	for (i = 0; i < argc; ++i) {
+		char *argument = argv[i];
+		char action;
+		int num;
+
+		if (argument[0] != '-')
+			clay_usage();
+
+		action = argument[1];
+		num = strtol(argument + 2, &argument, 10);
+
+		if (*argument != '\0' || num < 0)
+			clay_usage();
+
+		switch (action) {
+		case 't':
+			if ((size_t)num >= cb_count) {
+				fprintf(stderr, "Test number %d does not exist.\n", num);
+				exit(-1);
+			}
+
+			clay_print("Started (%s::%s)\n",
+				suites[callbacks[num].suite_n].name,
+				callbacks[num].name);
+
+			clay_run_single(&callbacks[num], &suites[callbacks[num].suite_n]);
+			break;
+
+		case 's':
+			if ((size_t)num >= suite_count) {
+				fprintf(stderr, "Suite number %d does not exist.\n", num);
+				exit(-1);
+			}
+
+			clay_print("Started (%s::)\n", suites[num].name);
+			clay_run_suite(&suites[num]);
+			break;
+
+		default:
+			clay_usage();
+		}
+	}
+}
+
+static int
+clay_test(
+	int argc, char **argv,
+	const char *suites_str,
+	const struct clay_func *callbacks,
+	size_t cb_count,
+	const struct clay_suite *suites,
+	size_t suite_count)
+{
+	clay_print("Loaded %d suites: %s\n", (int)suite_count, suites_str);
+
+	if (!clay_sandbox())
+		return -1;
+
+	if (argc > 1) {
+		clay_parse_args(argc - 1, argv + 1,
+			callbacks, cb_count, suites, suite_count);
+
+	} else {
+		size_t i;
+		clay_print("Started\n");
+
+		for (i = 0; i < suite_count; ++i) {
+			const struct clay_suite *s = &suites[i];
+			clay_run_suite(s);
+		}
+	}
+
+	clay_print("\n\n");
+	clay_report_errors();
+
+	clay_unsandbox();
+	return _clay.total_errors;
+}
+
+void
+clay__assert(
+	int condition,
+	const char *file,
+	int line,
+	const char *error_msg,
+	const char *description,
+	int should_abort)
+{
+	struct clay_error *error;
+
+	if (condition)
+		return;
+
+	error = calloc(1, sizeof(struct clay_error));
+
+	if (_clay.errors == NULL)
+		_clay.errors = error;
+
+	if (_clay.last_error != NULL)
+		_clay.last_error->next = error;
+
+	_clay.last_error = error;
+
+	error->test = _clay.active_test;
+	error->test_number = _clay.test_count;
+	error->suite = _clay.active_suite;
+	error->file = file;
+	error->line_number = line;
+	error->error_msg = error_msg;
+
+	if (description != NULL)
+		error->description = strdup(description);
+
+	_clay.suite_errors++;
+	_clay.total_errors++;
+
+	if (should_abort) {
+		if (!_clay.trampoline_enabled) {
+			fprintf(stderr,
+				"Unhandled exception: a cleanup method raised an exception.");
+			exit(-1);
+		}
+
+		longjmp(_clay.trampoline, -1);
+	}
+}
+
+void clay_set_cleanup(void (*cleanup)(void *), void *opaque)
+{
+	_clay.local_cleanup = cleanup;
+	_clay.local_cleanup_payload = opaque;
+}
+
+#ifdef _WIN32
+#	define PLATFORM_SEP '\\'
+#else
+#	define PLATFORM_SEP '/'
+#endif
+
+static char _clay_path[4096];
+
+static int
+is_valid_tmp_path(const char *path)
+{
+	struct stat st;
+	return (lstat(path, &st) == 0 &&
+		(S_ISDIR(st.st_mode) ||
+		S_ISLNK(st.st_mode)) &&
+		access(path, W_OK) == 0);
+}
+
+static int
+find_tmp_path(char *buffer, size_t length)
+{
+	static const size_t var_count = 4;
+	static const char *env_vars[] = {
+		"TMPDIR", "TMP", "TEMP", "USERPROFILE"
+ 	};
+
+ 	size_t i;
+
+#ifdef _WIN32
+	if (GetTempPath((DWORD)length, buffer))
+		return 1;
+#endif
+
+	for (i = 0; i < var_count; ++i) {
+		const char *env = getenv(env_vars[i]);
+		if (!env)
+			continue;
+
+		if (is_valid_tmp_path(env)) {
+			strncpy(buffer, env, length);
+			return 1;
+		}
+	}
+
+	return 0;
+}
+
+static int clean_folder(const char *path)
+{
+	const char os_cmd[] =
+#ifdef _WIN32
+		"rd /s /q \"%s\"";
+#else
+		"rm -rf \"%s\"";
+#endif
+
+	char command[4096];
+	snprintf(command, sizeof(command), os_cmd, path);
+	return system(command);
+}
+
+static void clay_unsandbox(void)
+{
+	clean_folder(_clay_path);
+}
+
+static int clay_sandbox(void)
+{
+	const char path_tail[] = "clay_tmp_XXXXXX";
+	size_t len;
+
+	if (!find_tmp_path(_clay_path, sizeof(_clay_path)))
+		return 0;
+
+	len = strlen(_clay_path);
+
+	if (_clay_path[len - 1] != PLATFORM_SEP) {
+		_clay_path[len++] = PLATFORM_SEP;
+	}
+
+	strcpy(_clay_path + len, path_tail);
+
+	if (mktemp(_clay_path) == NULL)
+		return 0;
+
+	if (mkdir(_clay_path, 0700) != 0)
+		return 0;
+
+	if (chdir(_clay_path) != 0)
+		return 0;
+
+	return 1;
+}
+
+
+
+extern void test_dirent__dont_traverse_dot(void);
+extern void test_dirent__traverse_subfolder(void);
+extern void test_dirent__traverse_slash_terminated_folder(void);
+extern void test_dirent__dont_traverse_empty_folders(void);
+extern void test_dirent__traverse_weird_filenames(void);
+extern void test_filebuf__0(void);
+extern void test_filebuf__1(void);
+extern void test_filebuf__2(void);
+extern void test_path__0(void);
+extern void test_path__1(void);
+extern void test_path__2(void);
+extern void test_path__5(void);
+extern void test_path__6(void);
+extern void test_rmdir__initialize();
+extern void test_rmdir__delete_recursive(void);
+extern void test_rmdir__fail_to_delete_non_empty_dir(void);
+extern void test_string__0(void);
+extern void test_string__1(void);
+extern void test_vector__0(void);
+extern void test_vector__1(void);
+extern void test_vector__2(void);
+
+static const struct clay_func _all_callbacks[] = {
+    {"dont_traverse_dot", &test_dirent__dont_traverse_dot, 0},
+	{"traverse_subfolder", &test_dirent__traverse_subfolder, 0},
+	{"traverse_slash_terminated_folder", &test_dirent__traverse_slash_terminated_folder, 0},
+	{"dont_traverse_empty_folders", &test_dirent__dont_traverse_empty_folders, 0},
+	{"traverse_weird_filenames", &test_dirent__traverse_weird_filenames, 0},
+	{"0", &test_filebuf__0, 1},
+	{"1", &test_filebuf__1, 1},
+	{"2", &test_filebuf__2, 1},
+	{"0", &test_path__0, 2},
+	{"1", &test_path__1, 2},
+	{"2", &test_path__2, 2},
+	{"5", &test_path__5, 2},
+	{"6", &test_path__6, 2},
+	{"delete_recursive", &test_rmdir__delete_recursive, 3},
+	{"fail_to_delete_non_empty_dir", &test_rmdir__fail_to_delete_non_empty_dir, 3},
+	{"0", &test_string__0, 4},
+	{"1", &test_string__1, 4},
+	{"0", &test_vector__0, 5},
+	{"1", &test_vector__1, 5},
+	{"2", &test_vector__2, 5}
+};
+
+static const struct clay_suite _all_suites[] = {
+    {
+        "dirent",
+        {NULL, NULL, 0},
+        {NULL, NULL, 0},
+        &_all_callbacks[0], 5
+    },
+	{
+        "filebuf",
+        {NULL, NULL, 0},
+        {NULL, NULL, 0},
+        &_all_callbacks[5], 3
+    },
+	{
+        "path",
+        {NULL, NULL, 0},
+        {NULL, NULL, 0},
+        &_all_callbacks[8], 5
+    },
+	{
+        "rmdir",
+        {"initialize", &test_rmdir__initialize, 3},
+        {NULL, NULL, 0},
+        &_all_callbacks[13], 2
+    },
+	{
+        "string",
+        {NULL, NULL, 0},
+        {NULL, NULL, 0},
+        &_all_callbacks[15], 2
+    },
+	{
+        "vector",
+        {NULL, NULL, 0},
+        {NULL, NULL, 0},
+        &_all_callbacks[17], 3
+    }
+};
+
+static const char _suites_str[] = "dirent, filebuf, path, rmdir, string, vector";
+
+int main(int argc, char *argv[])
+{
+    return clay_test(
+        argc, argv, _suites_str,
+        _all_callbacks, 20,
+        _all_suites, 6
+    );
+}
diff --git a/tests/dirent.c b/tests/dirent.c
new file mode 100644
index 0000000..1883fd0
--- /dev/null
+++ b/tests/dirent.c
@@ -0,0 +1,222 @@
+#include "clay_libgit2.h"
+#include "fileops.h"
+
+typedef struct name_data {
+	int  count;  /* return count */
+	char *name;  /* filename     */
+} name_data;
+
+typedef struct walk_data {
+	char *sub;        /* sub-directory name */
+	name_data *names; /* name state data    */
+} walk_data;
+
+
+static char path_buffer[GIT_PATH_MAX];
+static char *top_dir = "dir-walk";
+static walk_data *state_loc;
+
+static void setup(walk_data *d)
+{
+	name_data *n;
+
+	must_pass(p_mkdir(top_dir, 0755));
+
+	must_pass(p_chdir(top_dir));
+
+	if (strcmp(d->sub, ".") != 0)
+		must_pass(p_mkdir(d->sub, 0755));
+
+	strcpy(path_buffer, d->sub);
+	state_loc = d;
+
+	for (n = d->names; n->name; n++) {
+		git_file fd = p_creat(n->name, 0600);
+		must_be_true(fd >= 0);
+		p_close(fd);
+		n->count = 0;
+	}
+}
+
+static void dirent_cleanup__cb(void *_d)
+{
+	walk_data *d = _d;
+	name_data *n;
+
+	for (n = d->names; n->name; n++) {
+		must_pass(p_unlink(n->name));
+	}
+
+	if (strcmp(d->sub, ".") != 0)
+		must_pass(p_rmdir(d->sub));
+
+	must_pass(p_chdir(".."));
+
+	must_pass(p_rmdir(top_dir));
+}
+
+static void check_counts(walk_data *d)
+{
+	name_data *n;
+
+	for (n = d->names; n->name; n++) {
+		must_be_true(n->count == 1);
+	}
+}
+
+static int one_entry(void *state, char *path)
+{
+	walk_data *d = (walk_data *) state;
+	name_data *n;
+
+	if (state != state_loc)
+		return GIT_ERROR;
+
+	if (path != path_buffer)
+		return GIT_ERROR;
+
+	for (n = d->names; n->name; n++) {
+		if (!strcmp(n->name, path)) {
+			n->count++;
+			return 0;
+		}
+	}
+
+	return GIT_ERROR;
+}
+
+static int dont_call_me(void *GIT_UNUSED(state), char *GIT_UNUSED(path))
+{
+	GIT_UNUSED_ARG(state)
+	GIT_UNUSED_ARG(path)
+	return GIT_ERROR;
+}
+
+
+
+static name_data dot_names[] = {
+	{ 0, "./a" },
+	{ 0, "./asdf" },
+	{ 0, "./pack-foo.pack" },
+	{ 0, NULL }
+};
+static walk_data dot = {
+	".",
+	dot_names
+};
+
+/* make sure that the '.' folder is not traversed */
+void test_dirent__dont_traverse_dot(void)
+{
+	clay_set_cleanup(&dirent_cleanup__cb, &dot);
+	setup(&dot);
+
+	must_pass(git_futils_direach(path_buffer,
+			       sizeof(path_buffer),
+			       one_entry,
+			       &dot));
+
+	check_counts(&dot);
+}
+
+
+static name_data sub_names[] = {
+	{ 0, "sub/a" },
+	{ 0, "sub/asdf" },
+	{ 0, "sub/pack-foo.pack" },
+	{ 0, NULL }
+};
+static walk_data sub = {
+	"sub",
+	sub_names
+};
+
+/* traverse a subfolder */
+void test_dirent__traverse_subfolder(void)
+{
+	clay_set_cleanup(&dirent_cleanup__cb, &sub);
+	setup(&sub);
+
+	must_pass(git_futils_direach(path_buffer,
+			       sizeof(path_buffer),
+			       one_entry,
+			       &sub));
+
+	check_counts(&sub);
+}
+
+
+static walk_data sub_slash = {
+	"sub/",
+	sub_names
+};
+
+/* traverse a slash-terminated subfolder */
+void test_dirent__traverse_slash_terminated_folder(void)
+{
+	clay_set_cleanup(&dirent_cleanup__cb, &sub_slash);
+	setup(&sub_slash);
+
+	must_pass(git_futils_direach(path_buffer,
+			       sizeof(path_buffer),
+			       one_entry,
+			       &sub_slash));
+
+	check_counts(&sub_slash);
+}
+
+
+static name_data empty_names[] = {
+	{ 0, NULL }
+};
+static walk_data empty = {
+	"empty",
+	empty_names
+};
+
+/* make sure that empty folders are not traversed */
+void test_dirent__dont_traverse_empty_folders(void)
+{
+	clay_set_cleanup(&dirent_cleanup__cb, &empty);
+	setup(&empty);
+
+	must_pass(git_futils_direach(path_buffer,
+			       sizeof(path_buffer),
+			       one_entry,
+			       &empty));
+
+	check_counts(&empty);
+
+	/* make sure callback not called */
+	must_pass(git_futils_direach(path_buffer,
+			       sizeof(path_buffer),
+			       dont_call_me,
+			       &empty));
+}
+
+static name_data odd_names[] = {
+	{ 0, "odd/.a" },
+	{ 0, "odd/..c" },
+	/* the following don't work on cygwin/win32 */
+	/* { 0, "odd/.b." }, */
+	/* { 0, "odd/..d.." },  */
+	{ 0, NULL }
+};
+static walk_data odd = {
+	"odd",
+	odd_names
+};
+
+/* make sure that strange looking filenames ('..c') are traversed */
+void test_dirent__traverse_weird_filenames(void)
+{
+	clay_set_cleanup(&dirent_cleanup__cb, &odd);
+	setup(&odd);
+
+	must_pass(git_futils_direach(path_buffer,
+			       sizeof(path_buffer),
+			       one_entry,
+			       &odd));
+
+	check_counts(&odd);
+}
diff --git a/tests/filebuf.c b/tests/filebuf.c
new file mode 100644
index 0000000..9268e9f
--- /dev/null
+++ b/tests/filebuf.c
@@ -0,0 +1,54 @@
+#include "clay_libgit2.h"
+#include "filebuf.h"
+
+/* make sure git_filebuf_open doesn't delete an existing lock */
+void test_filebuf__0(void)
+{
+	git_filebuf file;
+	int fd;
+	char test[] = "test", testlock[] = "test.lock";
+
+	fd = p_creat(testlock, 0744);
+	must_pass(fd);
+	must_pass(p_close(fd));
+	must_fail(git_filebuf_open(&file, test, 0));
+	must_pass(git_futils_exists(testlock));
+	must_pass(p_unlink(testlock));
+}
+
+
+/* make sure GIT_FILEBUF_APPEND works as expected */
+void test_filebuf__1(void)
+{
+	git_filebuf file;
+	int fd;
+	char test[] = "test";
+
+	fd = p_creat(test, 0644);
+	must_pass(fd);
+	must_pass(p_write(fd, "libgit2 rocks\n", 14));
+	must_pass(p_close(fd));
+
+	must_pass(git_filebuf_open(&file, test, GIT_FILEBUF_APPEND));
+	must_pass(git_filebuf_printf(&file, "%s\n", "libgit2 rocks"));
+	must_pass(git_filebuf_commit(&file));
+
+	must_pass(p_unlink(test));
+}
+
+
+/* make sure git_filebuf_write writes large buffer correctly */
+void test_filebuf__2(void)
+{
+	git_filebuf file;
+	char test[] = "test";
+	unsigned char buf[4096 * 4]; /* 2 * WRITE_BUFFER_SIZE */
+
+	memset(buf, 0xfe, sizeof(buf));
+	must_pass(git_filebuf_open(&file, test, 0));
+	must_pass(git_filebuf_write(&file, buf, sizeof(buf)));
+	must_pass(git_filebuf_commit(&file));
+
+	must_pass(p_unlink(test));
+}
+
diff --git a/tests/path.c b/tests/path.c
new file mode 100644
index 0000000..95d207b
--- /dev/null
+++ b/tests/path.c
@@ -0,0 +1,139 @@
+#include "clay_libgit2.h"
+#include <fileops.h>
+
+static void
+check_dirname(const char *A, const char *B)
+{
+	char dir[64], *dir2;
+
+	must_be_true(git_path_dirname_r(dir, sizeof(dir), A) >= 0);
+	must_be_true(strcmp(dir, B) == 0);
+	must_be_true((dir2 = git_path_dirname(A)) != NULL);
+	must_be_true(strcmp(dir2, B) == 0);
+
+	free(dir2);
+}
+
+static void
+check_basename(const char *A, const char *B)
+{
+	char base[64], *base2;
+
+	must_be_true(git_path_basename_r(base, sizeof(base), A) >= 0);
+	must_be_true(strcmp(base, B) == 0);
+	must_be_true((base2 = git_path_basename(A)) != NULL);
+	must_be_true(strcmp(base2, B) == 0);
+
+	free(base2);
+}
+
+static void
+check_topdir(const char *A, const char *B)
+{
+	const char *dir;
+
+	must_be_true((dir = git_path_topdir(A)) != NULL);
+	must_be_true(strcmp(dir, B) == 0);
+}
+
+static void
+check_joinpath(const char *path_a, const char *path_b, const char *expected_path)
+{
+	char joined_path[GIT_PATH_MAX];
+
+	git_path_join(joined_path, path_a, path_b);
+	must_be_true(strcmp(joined_path, expected_path) == 0);
+}
+
+static void
+check_joinpath_n(
+	const char *path_a,
+	const char *path_b,
+	const char *path_c,
+	const char *path_d,
+	const char *expected_path)
+{
+	char joined_path[GIT_PATH_MAX];
+
+	git_path_join_n(joined_path, 4, path_a, path_b, path_c, path_d);
+	must_be_true(strcmp(joined_path, expected_path) == 0);
+}
+
+
+/* get the dirname of a path */
+void test_path__0(void)
+{
+
+	check_dirname(NULL, ".");
+	check_dirname("", ".");
+	check_dirname("a", ".");
+	check_dirname("/", "/");
+	check_dirname("/usr", "/");
+	check_dirname("/usr/", "/");
+	check_dirname("/usr/lib", "/usr");
+	check_dirname("/usr/lib/", "/usr");
+	check_dirname("/usr/lib//", "/usr");
+	check_dirname("usr/lib", "usr");
+	check_dirname("usr/lib/", "usr");
+	check_dirname("usr/lib//", "usr");
+	check_dirname(".git/", ".");
+}
+
+/* get the base name of a path */
+void test_path__1(void)
+{
+	check_basename(NULL, ".");
+	check_basename("", ".");
+	check_basename("a", "a");
+	check_basename("/", "/");
+	check_basename("/usr", "usr");
+	check_basename("/usr/", "usr");
+	check_basename("/usr/lib", "lib");
+	check_basename("/usr/lib//", "lib");
+	check_basename("usr/lib", "lib");
+}
+
+/* get the latest component in a path */
+void test_path__2(void)
+{
+	check_topdir(".git/", ".git/");
+	check_topdir("/.git/", ".git/");
+	check_topdir("usr/local/.git/", ".git/");
+	check_topdir("./.git/", ".git/");
+	check_topdir("/usr/.git/", ".git/");
+	check_topdir("/", "/");
+	check_topdir("a/", "a/");
+
+	must_be_true(git_path_topdir("/usr/.git") == NULL);
+	must_be_true(git_path_topdir(".") == NULL);
+	must_be_true(git_path_topdir("") == NULL);
+	must_be_true(git_path_topdir("a") == NULL);
+}
+
+/* properly join path components */
+void test_path__5(void)
+{
+	check_joinpath("", "", "");
+	check_joinpath("", "a", "a");
+	check_joinpath("", "/a", "/a");
+	check_joinpath("a", "", "a/");
+	check_joinpath("a", "/", "a/");
+	check_joinpath("a", "b", "a/b");
+	check_joinpath("/", "a", "/a");
+	check_joinpath("/", "", "/");
+	check_joinpath("/a", "/b", "/a/b");
+	check_joinpath("/a", "/b/", "/a/b/");
+	check_joinpath("/a/", "b/", "/a/b/");
+	check_joinpath("/a/", "/b/", "/a/b/");
+}
+
+/* properly join path components for more than one path */
+void test_path__6(void)
+{
+	check_joinpath_n("", "", "", "", "");
+	check_joinpath_n("", "a", "", "", "a/");
+	check_joinpath_n("a", "", "", "", "a/");
+	check_joinpath_n("", "", "", "a", "a");
+	check_joinpath_n("a", "b", "", "/c/d/", "a/b/c/d/");
+	check_joinpath_n("a", "b", "", "/c/d", "a/b/c/d");
+}
\ No newline at end of file
diff --git a/tests/rmdir.c b/tests/rmdir.c
new file mode 100644
index 0000000..5c3511a
--- /dev/null
+++ b/tests/rmdir.c
@@ -0,0 +1,49 @@
+#include "clay_libgit2.h"
+#include "fileops.h"
+
+static const char *empty_tmp_dir = "test_gitfo_rmdir_recurs_test";
+
+void test_rmdir__initialize()
+{
+	char path[GIT_PATH_MAX];
+
+	must_pass(p_mkdir(empty_tmp_dir, 0755));
+
+	git_path_join(path, empty_tmp_dir, "/one");
+	must_pass(p_mkdir(path, 0755));
+
+	git_path_join(path, empty_tmp_dir, "/one/two_one");
+	must_pass(p_mkdir(path, 0755));
+
+	git_path_join(path, empty_tmp_dir, "/one/two_two");
+	must_pass(p_mkdir(path, 0755));
+
+	git_path_join(path, empty_tmp_dir, "/one/two_two/three");
+	must_pass(p_mkdir(path, 0755));
+
+	git_path_join(path, empty_tmp_dir, "/two");
+	must_pass(p_mkdir(path, 0755));
+}
+
+/* make sure empty dir can be deleted recusively */
+void test_rmdir__delete_recursive(void)
+{
+	must_pass(git_futils_rmdir_r(empty_tmp_dir, 0));
+}
+
+/* make sure non-empty dir cannot be deleted recusively */
+void test_rmdir__fail_to_delete_non_empty_dir(void)
+{
+	char file[GIT_PATH_MAX];
+	int fd;
+
+	git_path_join(file, empty_tmp_dir, "/two/file.txt");
+
+	fd = p_creat(file, 0755);
+	must_be_true(fd >= 0);
+
+	must_pass(p_close(fd));
+	must_fail(git_futils_rmdir_r(empty_tmp_dir, 0));
+	must_pass(p_unlink(file));
+	must_pass(git_futils_rmdir_r(empty_tmp_dir, 0));
+}
diff --git a/tests/string.c b/tests/string.c
new file mode 100644
index 0000000..250ce33
--- /dev/null
+++ b/tests/string.c
@@ -0,0 +1,28 @@
+#include "clay_libgit2.h"
+
+/* compare prefixes */
+void test_string__0(void)
+{
+	must_be_true(git__prefixcmp("", "") == 0);
+	must_be_true(git__prefixcmp("a", "") == 0);
+	must_be_true(git__prefixcmp("", "a") < 0);
+	must_be_true(git__prefixcmp("a", "b") < 0);
+	must_be_true(git__prefixcmp("b", "a") > 0);
+	must_be_true(git__prefixcmp("ab", "a") == 0);
+	must_be_true(git__prefixcmp("ab", "ac") < 0);
+	must_be_true(git__prefixcmp("ab", "aa") > 0);
+}
+
+/* compare suffixes */
+void test_string__1(void)
+{
+	must_be_true(git__suffixcmp("", "") == 0);
+	must_be_true(git__suffixcmp("a", "") == 0);
+	must_be_true(git__suffixcmp("", "a") < 0);
+	must_be_true(git__suffixcmp("a", "b") < 0);
+	must_be_true(git__suffixcmp("b", "a") > 0);
+	must_be_true(git__suffixcmp("ba", "a") == 0);
+	must_be_true(git__suffixcmp("zaa", "ac") < 0);
+	must_be_true(git__suffixcmp("zaz", "ac") > 0);
+}
+
diff --git a/tests/t00-core.c b/tests/t00-core.c
deleted file mode 100644
index 6d63d1c..0000000
--- a/tests/t00-core.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-
-#include "vector.h"
-#include "fileops.h"
-#include "filebuf.h"
-
-BEGIN_TEST(string0, "compare prefixes")
-	must_be_true(git__prefixcmp("", "") == 0);
-	must_be_true(git__prefixcmp("a", "") == 0);
-	must_be_true(git__prefixcmp("", "a") < 0);
-	must_be_true(git__prefixcmp("a", "b") < 0);
-	must_be_true(git__prefixcmp("b", "a") > 0);
-	must_be_true(git__prefixcmp("ab", "a") == 0);
-	must_be_true(git__prefixcmp("ab", "ac") < 0);
-	must_be_true(git__prefixcmp("ab", "aa") > 0);
-END_TEST
-
-BEGIN_TEST(string1, "compare suffixes")
-	must_be_true(git__suffixcmp("", "") == 0);
-	must_be_true(git__suffixcmp("a", "") == 0);
-	must_be_true(git__suffixcmp("", "a") < 0);
-	must_be_true(git__suffixcmp("a", "b") < 0);
-	must_be_true(git__suffixcmp("b", "a") > 0);
-	must_be_true(git__suffixcmp("ba", "a") == 0);
-	must_be_true(git__suffixcmp("zaa", "ac") < 0);
-	must_be_true(git__suffixcmp("zaz", "ac") > 0);
-END_TEST
-
-
-BEGIN_TEST(vector0, "initial size of 1 would cause writing past array bounds")
-  git_vector x;
-  int i;
-  git_vector_init(&x, 1, NULL);
-  for (i = 0; i < 10; ++i) {
-    git_vector_insert(&x, (void*) 0xabc);
-  }
-  git_vector_free(&x);
-END_TEST
-
-BEGIN_TEST(vector1, "don't read past array bounds on remove()")
-  git_vector x;
-  // make initial capacity exact for our insertions.
-  git_vector_init(&x, 3, NULL);
-  git_vector_insert(&x, (void*) 0xabc);
-  git_vector_insert(&x, (void*) 0xdef);
-  git_vector_insert(&x, (void*) 0x123);
-
-  git_vector_remove(&x, 0);  // used to read past array bounds.
-  git_vector_free(&x);
-END_TEST
-
-static int test_cmp(const void *a, const void *b)
-{
-	return *(const int *)a - *(const int *)b;
-}
-
-BEGIN_TEST(vector2, "remove duplicates")
-	git_vector x;
-	int *ptrs[2];
-
-	ptrs[0] = git__malloc(sizeof(int));
-	ptrs[1] = git__malloc(sizeof(int));
-
-	*ptrs[0] = 2;
-	*ptrs[1] = 1;
-
-	must_pass(git_vector_init(&x, 5, test_cmp));
-	must_pass(git_vector_insert(&x, ptrs[0]));
-	must_pass(git_vector_insert(&x, ptrs[1]));
-	must_pass(git_vector_insert(&x, ptrs[1]));
-	must_pass(git_vector_insert(&x, ptrs[0]));
-	must_pass(git_vector_insert(&x, ptrs[1]));
-	must_be_true(x.length == 5);
-	git_vector_uniq(&x);
-	must_be_true(x.length == 2);
-	git_vector_free(&x);
-
-	free(ptrs[0]);
-	free(ptrs[1]);
-END_TEST
-
-
-BEGIN_TEST(path0, "get the dirname of a path")
-	char dir[64], *dir2;
-
-#define DIRNAME_TEST(A, B) { \
-	must_be_true(git_path_dirname_r(dir, sizeof(dir), A) >= 0); \
-	must_be_true(strcmp(dir, B) == 0);				\
-	must_be_true((dir2 = git_path_dirname(A)) != NULL);	\
-	must_be_true(strcmp(dir2, B) == 0);				\
-	free(dir2);										\
-}
-
-	DIRNAME_TEST(NULL, ".");
-	DIRNAME_TEST("", ".");
-	DIRNAME_TEST("a", ".");
-	DIRNAME_TEST("/", "/");
-	DIRNAME_TEST("/usr", "/");
-	DIRNAME_TEST("/usr/", "/");
-	DIRNAME_TEST("/usr/lib", "/usr");
-	DIRNAME_TEST("/usr/lib/", "/usr");
-	DIRNAME_TEST("/usr/lib//", "/usr");
-	DIRNAME_TEST("usr/lib", "usr");
-	DIRNAME_TEST("usr/lib/", "usr");
-	DIRNAME_TEST("usr/lib//", "usr");
-	DIRNAME_TEST(".git/", ".");
-
-#undef DIRNAME_TEST
-
-END_TEST
-
-BEGIN_TEST(path1, "get the base name of a path")
-	char base[64], *base2;
-
-#define BASENAME_TEST(A, B) { \
-	must_be_true(git_path_basename_r(base, sizeof(base), A) >= 0); \
-	must_be_true(strcmp(base, B) == 0);					\
-	must_be_true((base2 = git_path_basename(A)) != NULL);	\
-	must_be_true(strcmp(base2, B) == 0);				\
-	free(base2);										\
-}
-
-	BASENAME_TEST(NULL, ".");
-	BASENAME_TEST("", ".");
-	BASENAME_TEST("a", "a");
-	BASENAME_TEST("/", "/");
-	BASENAME_TEST("/usr", "usr");
-	BASENAME_TEST("/usr/", "usr");
-	BASENAME_TEST("/usr/lib", "lib");
-	BASENAME_TEST("/usr/lib//", "lib");
-	BASENAME_TEST("usr/lib", "lib");
-
-#undef BASENAME_TEST
-
-END_TEST
-
-BEGIN_TEST(path2, "get the latest component in a path")
-	const char *dir;
-
-#define TOPDIR_TEST(A, B) { \
-	must_be_true((dir = git_path_topdir(A)) != NULL);	\
-	must_be_true(strcmp(dir, B) == 0);				\
-}
-
-	TOPDIR_TEST(".git/", ".git/");
-	TOPDIR_TEST("/.git/", ".git/");
-	TOPDIR_TEST("usr/local/.git/", ".git/");
-	TOPDIR_TEST("./.git/", ".git/");
-	TOPDIR_TEST("/usr/.git/", ".git/");
-	TOPDIR_TEST("/", "/");
-	TOPDIR_TEST("a/", "a/");
-
-	must_be_true(git_path_topdir("/usr/.git") == NULL);
-	must_be_true(git_path_topdir(".") == NULL);
-	must_be_true(git_path_topdir("") == NULL);
-	must_be_true(git_path_topdir("a") == NULL);
-
-#undef TOPDIR_TEST
-END_TEST
-
-static int ensure_joinpath(const char *path_a, const char *path_b, const char *expected_path)
-{
-	char joined_path[GIT_PATH_MAX];
-	git_path_join(joined_path, path_a, path_b);
-	return strcmp(joined_path, expected_path) == 0 ? GIT_SUCCESS : GIT_ERROR;
-}
-
-BEGIN_TEST(path5, "properly join path components")
-	must_pass(ensure_joinpath("", "", ""));
-	must_pass(ensure_joinpath("", "a", "a"));
-	must_pass(ensure_joinpath("", "/a", "/a"));
-	must_pass(ensure_joinpath("a", "", "a/"));
-	must_pass(ensure_joinpath("a", "/", "a/"));
-	must_pass(ensure_joinpath("a", "b", "a/b"));
-	must_pass(ensure_joinpath("/", "a", "/a"));
-	must_pass(ensure_joinpath("/", "", "/"));
-	must_pass(ensure_joinpath("/a", "/b", "/a/b"));
-	must_pass(ensure_joinpath("/a", "/b/", "/a/b/"));
-	must_pass(ensure_joinpath("/a/", "b/", "/a/b/"));
-	must_pass(ensure_joinpath("/a/", "/b/", "/a/b/"));
-END_TEST
-
-static int ensure_joinpath_n(const char *path_a, const char *path_b, const char *path_c, const char *path_d, const char *expected_path)
-{
-	char joined_path[GIT_PATH_MAX];
-	git_path_join_n(joined_path, 4, path_a, path_b, path_c, path_d);
-	return strcmp(joined_path, expected_path) == 0 ? GIT_SUCCESS : GIT_ERROR;
-}
-
-BEGIN_TEST(path6, "properly join path components for more than one path")
-	must_pass(ensure_joinpath_n("", "", "", "", ""));
-	must_pass(ensure_joinpath_n("", "a", "", "", "a/"));
-	must_pass(ensure_joinpath_n("a", "", "", "", "a/"));
-	must_pass(ensure_joinpath_n("", "", "", "a", "a"));
-	must_pass(ensure_joinpath_n("a", "b", "", "/c/d/", "a/b/c/d/"));
-	must_pass(ensure_joinpath_n("a", "b", "", "/c/d", "a/b/c/d"));
-END_TEST
-
-typedef struct name_data {
-	int  count;  /* return count */
-	char *name;  /* filename     */
-} name_data;
-
-typedef struct walk_data {
-	char *sub;        /* sub-directory name */
-	name_data *names; /* name state data    */
-} walk_data;
-
-
-static char path_buffer[GIT_PATH_MAX];
-static char *top_dir = "dir-walk";
-static walk_data *state_loc;
-
-static int error(const char *fmt, ...)
-{
-	va_list ap;
-
-	va_start(ap, fmt);
-	vfprintf(stderr, fmt, ap);
-	va_end(ap);
-	fprintf(stderr, "\n");
-	return -1;
-}
-
-static int setup(walk_data *d)
-{
-	name_data *n;
-
-	if (p_mkdir(top_dir, 0755) < 0)
-		return error("can't mkdir(\"%s\")", top_dir);
-
-	if (p_chdir(top_dir) < 0)
-		return error("can't chdir(\"%s\")", top_dir);
-
-	if (strcmp(d->sub, ".") != 0)
-		if (p_mkdir(d->sub, 0755) < 0)
-			return error("can't mkdir(\"%s\")", d->sub);
-
-	strcpy(path_buffer, d->sub);
-	state_loc = d;
-
-	for (n = d->names; n->name; n++) {
-		git_file fd = p_creat(n->name, 0600);
-		if (fd < 0)
-			return GIT_ERROR;
-		p_close(fd);
-		n->count = 0;
-	}
-
-	return 0;
-}
-
-static int knockdown(walk_data *d)
-{
-	name_data *n;
-
-	for (n = d->names; n->name; n++) {
-		if (p_unlink(n->name) < 0)
-			return error("can't unlink(\"%s\")", n->name);
-	}
-
-	if (strcmp(d->sub, ".") != 0)
-		if (p_rmdir(d->sub) < 0)
-			return error("can't rmdir(\"%s\")", d->sub);
-
-	if (p_chdir("..") < 0)
-		return error("can't chdir(\"..\")");
-
-	if (p_rmdir(top_dir) < 0)
-		return error("can't rmdir(\"%s\")", top_dir);
-
-	return 0;
-}
-
-static int check_counts(walk_data *d)
-{
-	int ret = 0;
-	name_data *n;
-
-	for (n = d->names; n->name; n++) {
-		if (n->count != 1)
-			ret = error("count (%d, %s)", n->count, n->name);
-	}
-	return ret;
-}
-
-static int one_entry(void *state, char *path)
-{
-	walk_data *d = (walk_data *) state;
-	name_data *n;
-
-	if (state != state_loc)
-		return GIT_ERROR;
-
-	if (path != path_buffer)
-		return GIT_ERROR;
-
-	for (n = d->names; n->name; n++) {
-		if (!strcmp(n->name, path)) {
-			n->count++;
-			return 0;
-		}
-	}
-
-	return GIT_ERROR;
-}
-
-
-static name_data dot_names[] = {
-	{ 0, "./a" },
-	{ 0, "./asdf" },
-	{ 0, "./pack-foo.pack" },
-	{ 0, NULL }
-};
-static walk_data dot = {
-	".",
-	dot_names
-};
-
-BEGIN_TEST(dirent0, "make sure that the '.' folder is not traversed")
-
-	must_pass(setup(&dot));
-
-	must_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &dot));
-
-	must_pass(check_counts(&dot));
-
-	must_pass(knockdown(&dot));
-END_TEST
-
-static name_data sub_names[] = {
-	{ 0, "sub/a" },
-	{ 0, "sub/asdf" },
-	{ 0, "sub/pack-foo.pack" },
-	{ 0, NULL }
-};
-static walk_data sub = {
-	"sub",
-	sub_names
-};
-
-BEGIN_TEST(dirent1, "traverse a subfolder")
-
-	must_pass(setup(&sub));
-
-	must_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &sub));
-
-	must_pass(check_counts(&sub));
-
-	must_pass(knockdown(&sub));
-END_TEST
-
-static walk_data sub_slash = {
-	"sub/",
-	sub_names
-};
-
-BEGIN_TEST(dirent2, "traverse a slash-terminated subfolder")
-
-	must_pass(setup(&sub_slash));
-
-	must_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &sub_slash));
-
-	must_pass(check_counts(&sub_slash));
-
-	must_pass(knockdown(&sub_slash));
-END_TEST
-
-static name_data empty_names[] = {
-	{ 0, NULL }
-};
-static walk_data empty = {
-	"empty",
-	empty_names
-};
-
-static int dont_call_me(void *GIT_UNUSED(state), char *GIT_UNUSED(path))
-{
-	GIT_UNUSED_ARG(state)
-	GIT_UNUSED_ARG(path)
-	return GIT_ERROR;
-}
-
-BEGIN_TEST(dirent3, "make sure that empty folders are not traversed")
-
-	must_pass(setup(&empty));
-
-	must_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &empty));
-
-	must_pass(check_counts(&empty));
-
-	/* make sure callback not called */
-	must_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       dont_call_me,
-			       &empty));
-
-	must_pass(knockdown(&empty));
-END_TEST
-
-static name_data odd_names[] = {
-	{ 0, "odd/.a" },
-	{ 0, "odd/..c" },
-	/* the following don't work on cygwin/win32 */
-	/* { 0, "odd/.b." }, */
-	/* { 0, "odd/..d.." },  */
-	{ 0, NULL }
-};
-static walk_data odd = {
-	"odd",
-	odd_names
-};
-
-BEGIN_TEST(dirent4, "make sure that strange looking filenames ('..c') are traversed")
-
-	must_pass(setup(&odd));
-
-	must_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &odd));
-
-	must_pass(check_counts(&odd));
-
-	must_pass(knockdown(&odd));
-END_TEST
-
-BEGIN_TEST(filebuf0, "make sure git_filebuf_open doesn't delete an existing lock")
-	git_filebuf file;
-	int fd;
-	char test[] = "test", testlock[] = "test.lock";
-
-	fd = p_creat(testlock, 0744);
-	must_pass(fd);
-	must_pass(p_close(fd));
-	must_fail(git_filebuf_open(&file, test, 0));
-	must_pass(git_futils_exists(testlock));
-	must_pass(p_unlink(testlock));
-END_TEST
-
-BEGIN_TEST(filebuf1, "make sure GIT_FILEBUF_APPEND works as expected")
-	git_filebuf file;
-	int fd;
-	char test[] = "test";
-
-	fd = p_creat(test, 0644);
-	must_pass(fd);
-	must_pass(p_write(fd, "libgit2 rocks\n", 14));
-	must_pass(p_close(fd));
-
-	must_pass(git_filebuf_open(&file, test, GIT_FILEBUF_APPEND));
-	must_pass(git_filebuf_printf(&file, "%s\n", "libgit2 rocks"));
-	must_pass(git_filebuf_commit(&file));
-
-	must_pass(p_unlink(test));
-END_TEST
-
-BEGIN_TEST(filebuf2, "make sure git_filebuf_write writes large buffer correctly")
-	git_filebuf file;
-	char test[] = "test";
-	unsigned char buf[4096 * 4]; /* 2 * WRITE_BUFFER_SIZE */
-
-	memset(buf, 0xfe, sizeof(buf));
-	must_pass(git_filebuf_open(&file, test, 0));
-	must_pass(git_filebuf_write(&file, buf, sizeof(buf)));
-	must_pass(git_filebuf_commit(&file));
-
-	must_pass(p_unlink(test));
-END_TEST
-
-static char *empty_tmp_dir = "test_gitfo_rmdir_recurs_test";
-
-static int setup_empty_tmp_dir()
-{
-	char path[GIT_PATH_MAX];
-
-	if (p_mkdir(empty_tmp_dir, 0755))
-		return -1;
-
-	git_path_join(path, empty_tmp_dir, "/one");
-	if (p_mkdir(path, 0755))
-		return -1;
-
-	git_path_join(path, empty_tmp_dir, "/one/two_one");
-	if (p_mkdir(path, 0755))
-		return -1;
-
-	git_path_join(path, empty_tmp_dir, "/one/two_two");
-	if (p_mkdir(path, 0755))
-		return -1;
-
-	git_path_join(path, empty_tmp_dir, "/one/two_two/three");
-	if (p_mkdir(path, 0755))
-		return -1;
-
-	git_path_join(path, empty_tmp_dir, "/two");
-	if (p_mkdir(path, 0755))
-		return -1;
-
-	return 0;
-}
-
-BEGIN_TEST(rmdir0, "make sure empty dir can be deleted recusively")
-	must_pass(setup_empty_tmp_dir());
-	must_pass(git_futils_rmdir_r(empty_tmp_dir, 0));
-END_TEST
-
-BEGIN_TEST(rmdir1, "make sure non-empty dir cannot be deleted recusively")
-	char file[GIT_PATH_MAX];
-	int fd;
-
-	must_pass(setup_empty_tmp_dir());
-	git_path_join(file, empty_tmp_dir, "/two/file.txt");
-	fd = p_creat(file, 0755);
-	must_pass(fd);
-	must_pass(p_close(fd));
-	must_fail(git_futils_rmdir_r(empty_tmp_dir, 0));
-	must_pass(p_unlink(file));
-	must_pass(git_futils_rmdir_r(empty_tmp_dir, 0));
-END_TEST
-
-BEGIN_SUITE(core)
-	ADD_TEST(string0);
-	ADD_TEST(string1);
-
-	ADD_TEST(vector0);
-	ADD_TEST(vector1);
-	ADD_TEST(vector2);
-
-	ADD_TEST(path0);
-	ADD_TEST(path1);
-	ADD_TEST(path2);
-	ADD_TEST(path5);
-	ADD_TEST(path6);
-
-	ADD_TEST(dirent0);
-	ADD_TEST(dirent1);
-	ADD_TEST(dirent2);
-	ADD_TEST(dirent3);
-	ADD_TEST(dirent4);
-
-	ADD_TEST(filebuf0);
-	ADD_TEST(filebuf1);
-	ADD_TEST(filebuf2);
-
-	ADD_TEST(rmdir0);
-	ADD_TEST(rmdir1);
-END_SUITE
diff --git a/tests/t01-data.h b/tests/t01-data.h
deleted file mode 100644
index 268269d..0000000
--- a/tests/t01-data.h
+++ /dev/null
@@ -1,322 +0,0 @@
-
-/*
- * Raw data
- */
-static unsigned char commit_data[] = {
-    0x74, 0x72, 0x65, 0x65, 0x20, 0x64, 0x66, 0x66,
-    0x32, 0x64, 0x61, 0x39, 0x30, 0x62, 0x32, 0x35,
-    0x34, 0x65, 0x31, 0x62, 0x65, 0x62, 0x38, 0x38,
-    0x39, 0x64, 0x31, 0x66, 0x31, 0x66, 0x31, 0x32,
-    0x38, 0x38, 0x62, 0x65, 0x31, 0x38, 0x30, 0x33,
-    0x37, 0x38, 0x32, 0x64, 0x66, 0x0a, 0x61, 0x75,
-    0x74, 0x68, 0x6f, 0x72, 0x20, 0x41, 0x20, 0x55,
-    0x20, 0x54, 0x68, 0x6f, 0x72, 0x20, 0x3c, 0x61,
-    0x75, 0x74, 0x68, 0x6f, 0x72, 0x40, 0x65, 0x78,
-    0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
-    0x6d, 0x3e, 0x20, 0x31, 0x32, 0x32, 0x37, 0x38,
-    0x31, 0x34, 0x32, 0x39, 0x37, 0x20, 0x2b, 0x30,
-    0x30, 0x30, 0x30, 0x0a, 0x63, 0x6f, 0x6d, 0x6d,
-    0x69, 0x74, 0x74, 0x65, 0x72, 0x20, 0x43, 0x20,
-    0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74, 0x65, 0x72,
-    0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
-    0x74, 0x65, 0x72, 0x40, 0x65, 0x78, 0x61, 0x6d,
-    0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x3e,
-    0x20, 0x31, 0x32, 0x32, 0x37, 0x38, 0x31, 0x34,
-    0x32, 0x39, 0x37, 0x20, 0x2b, 0x30, 0x30, 0x30,
-    0x30, 0x0a, 0x0a, 0x41, 0x20, 0x6f, 0x6e, 0x65,
-    0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x6d, 0x69, 0x74, 0x20, 0x73, 0x75, 0x6d,
-    0x6d, 0x61, 0x72, 0x79, 0x0a, 0x0a, 0x54, 0x68,
-    0x65, 0x20, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x6f,
-    0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x6d, 0x69, 0x74, 0x20, 0x6d, 0x65, 0x73,
-    0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x63, 0x6f,
-    0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67,
-    0x20, 0x66, 0x75, 0x72, 0x74, 0x68, 0x65, 0x72,
-    0x20, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61,
-    0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x6f, 0x66, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x72, 0x70,
-    0x6f, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67,
-    0x65, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f,
-    0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d,
-    0x6d, 0x69, 0x74, 0x2e, 0x0a, 0x0a, 0x53, 0x69,
-    0x67, 0x6e, 0x65, 0x64, 0x2d, 0x6f, 0x66, 0x2d,
-    0x62, 0x79, 0x3a, 0x20, 0x41, 0x20, 0x55, 0x20,
-    0x54, 0x68, 0x6f, 0x72, 0x20, 0x3c, 0x61, 0x75,
-    0x74, 0x68, 0x6f, 0x72, 0x40, 0x65, 0x78, 0x61,
-    0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
-    0x3e, 0x0a,
-};
-
-
-static unsigned char tree_data[] = {
-    0x31, 0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x6f,
-    0x6e, 0x65, 0x00, 0x8b, 0x13, 0x78, 0x91, 0x79,
-    0x1f, 0xe9, 0x69, 0x27, 0xad, 0x78, 0xe6, 0x4b,
-    0x0a, 0xad, 0x7b, 0xde, 0xd0, 0x8b, 0xdc, 0x31,
-    0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x73, 0x6f,
-    0x6d, 0x65, 0x00, 0xfd, 0x84, 0x30, 0xbc, 0x86,
-    0x4c, 0xfc, 0xd5, 0xf1, 0x0e, 0x55, 0x90, 0xf8,
-    0xa4, 0x47, 0xe0, 0x1b, 0x94, 0x2b, 0xfe, 0x31,
-    0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x74, 0x77,
-    0x6f, 0x00, 0x78, 0x98, 0x19, 0x22, 0x61, 0x3b,
-    0x2a, 0xfb, 0x60, 0x25, 0x04, 0x2f, 0xf6, 0xbd,
-    0x87, 0x8a, 0xc1, 0x99, 0x4e, 0x85, 0x31, 0x30,
-    0x30, 0x36, 0x34, 0x34, 0x20, 0x7a, 0x65, 0x72,
-    0x6f, 0x00, 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1,
-    0xd6, 0x43, 0x4b, 0x8b, 0x29, 0xae, 0x77, 0x5a,
-    0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91,
-};
-
-static unsigned char tag_data[] = {
-    0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x33,
-    0x64, 0x37, 0x66, 0x38, 0x61, 0x36, 0x61, 0x66,
-    0x30, 0x37, 0x36, 0x63, 0x38, 0x63, 0x33, 0x66,
-    0x32, 0x30, 0x30, 0x37, 0x31, 0x61, 0x38, 0x39,
-    0x33, 0x35, 0x63, 0x64, 0x62, 0x65, 0x38, 0x32,
-    0x32, 0x38, 0x35, 0x39, 0x34, 0x64, 0x31, 0x0a,
-    0x74, 0x79, 0x70, 0x65, 0x20, 0x63, 0x6f, 0x6d,
-    0x6d, 0x69, 0x74, 0x0a, 0x74, 0x61, 0x67, 0x20,
-    0x76, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x0a, 0x74,
-    0x61, 0x67, 0x67, 0x65, 0x72, 0x20, 0x43, 0x20,
-    0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74, 0x65, 0x72,
-    0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
-    0x74, 0x65, 0x72, 0x40, 0x65, 0x78, 0x61, 0x6d,
-    0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x3e,
-    0x20, 0x31, 0x32, 0x32, 0x37, 0x38, 0x31, 0x34,
-    0x32, 0x39, 0x37, 0x20, 0x2b, 0x30, 0x30, 0x30,
-    0x30, 0x0a, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20,
-    0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,
-    0x61, 0x67, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63,
-    0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65,
-    0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x76, 0x30,
-    0x2e, 0x30, 0x2e, 0x31, 0x0a,
-};
-
-static unsigned char zero_data[] = {
-    0x00  /* dummy data */
-};
-
-static unsigned char one_data[] = {
-    0x0a,
-};
-
-static unsigned char two_data[] = {
-    0x61, 0x0a,
-};
-
-static unsigned char some_data[] = {
-    0x2f, 0x2a, 0x0a, 0x20, 0x2a, 0x20, 0x54, 0x68,
-    0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20,
-    0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20,
-    0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x3b, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61,
-    0x6e, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74,
-    0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x69,
-    0x74, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72,
-    0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x0a,
-    0x20, 0x2a, 0x20, 0x69, 0x74, 0x20, 0x75, 0x6e,
-    0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c,
-    0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
-    0x20, 0x32, 0x2c, 0x0a, 0x20, 0x2a, 0x20, 0x61,
-    0x73, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
-    0x68, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20,
-    0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x2a, 0x0a,
-    0x20, 0x2a, 0x20, 0x49, 0x6e, 0x20, 0x61, 0x64,
-    0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74,
-    0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x65,
-    0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
-    0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,
-    0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x65, 0x6e,
-    0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62,
-    0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65,
-    0x6e, 0x73, 0x65, 0x2c, 0x0a, 0x20, 0x2a, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x61, 0x75, 0x74, 0x68,
-    0x6f, 0x72, 0x73, 0x20, 0x67, 0x69, 0x76, 0x65,
-    0x20, 0x79, 0x6f, 0x75, 0x20, 0x75, 0x6e, 0x6c,
-    0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x70,
-    0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
-    0x6e, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x6e,
-    0x6b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x0a, 0x20,
-    0x2a, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
-    0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69,
-    0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x69,
-    0x6e, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x62,
-    0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
-    0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6f, 0x74,
-    0x68, 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67,
-    0x72, 0x61, 0x6d, 0x73, 0x2c, 0x0a, 0x20, 0x2a,
-    0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20,
-    0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75,
-    0x74, 0x65, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65,
-    0x20, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61,
-    0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69,
-    0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x6e,
-    0x79, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69,
-    0x63, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x2a,
-    0x20, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x20,
-    0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65,
-    0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20,
-    0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c,
-    0x65, 0x2e, 0x20, 0x20, 0x28, 0x54, 0x68, 0x65,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a,
-    0x20, 0x2a, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72,
-    0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,
-    0x64, 0x6f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79,
-    0x20, 0x69, 0x6e, 0x20, 0x6f, 0x74, 0x68, 0x65,
-    0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63,
-    0x74, 0x73, 0x3b, 0x20, 0x66, 0x6f, 0x72, 0x20,
-    0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c,
-    0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x63, 0x6f,
-    0x76, 0x65, 0x72, 0x0a, 0x20, 0x2a, 0x20, 0x6d,
-    0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c,
-    0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x73,
-    0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f,
-    0x6e, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6e,
-    0x6f, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x6b, 0x65,
-    0x64, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x0a, 0x20,
-    0x2a, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x62,
-    0x69, 0x6e, 0x65, 0x64, 0x20, 0x65, 0x78, 0x65,
-    0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e,
-    0x29, 0x0a, 0x20, 0x2a, 0x0a, 0x20, 0x2a, 0x20,
-    0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c,
-    0x65, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73,
-    0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64,
-    0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x68, 0x6f, 0x70, 0x65, 0x20, 0x74, 0x68, 0x61,
-    0x74, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c,
-    0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65,
-    0x66, 0x75, 0x6c, 0x2c, 0x20, 0x62, 0x75, 0x74,
-    0x0a, 0x20, 0x2a, 0x20, 0x57, 0x49, 0x54, 0x48,
-    0x4f, 0x55, 0x54, 0x20, 0x41, 0x4e, 0x59, 0x20,
-    0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59,
-    0x3b, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75,
-    0x74, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69,
-    0x65, 0x64, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61,
-    0x6e, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x0a, 0x20,
-    0x2a, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41,
-    0x4e, 0x54, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54,
-    0x59, 0x20, 0x6f, 0x72, 0x20, 0x46, 0x49, 0x54,
-    0x4e, 0x45, 0x53, 0x53, 0x20, 0x46, 0x4f, 0x52,
-    0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49,
-    0x43, 0x55, 0x4c, 0x41, 0x52, 0x20, 0x50, 0x55,
-    0x52, 0x50, 0x4f, 0x53, 0x45, 0x2e, 0x20, 0x20,
-    0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x47, 0x4e, 0x55, 0x0a, 0x20, 0x2a, 0x20, 0x47,
-    0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50,
-    0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69,
-    0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x66, 0x6f,
-    0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x64,
-    0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x0a,
-    0x20, 0x2a, 0x0a, 0x20, 0x2a, 0x20, 0x59, 0x6f,
-    0x75, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,
-    0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, 0x65,
-    0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x61,
-    0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a,
-    0x20, 0x2a, 0x20, 0x61, 0x6c, 0x6f, 0x6e, 0x67,
-    0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68,
-    0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72,
-    0x61, 0x6d, 0x3b, 0x20, 0x73, 0x65, 0x65, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65,
-    0x20, 0x43, 0x4f, 0x50, 0x59, 0x49, 0x4e, 0x47,
-    0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f,
-    0x74, 0x2c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65,
-    0x20, 0x74, 0x6f, 0x0a, 0x20, 0x2a, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20,
-    0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x35, 0x31, 0x20,
-    0x46, 0x72, 0x61, 0x6e, 0x6b, 0x6c, 0x69, 0x6e,
-    0x20, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74, 0x2c,
-    0x20, 0x46, 0x69, 0x66, 0x74, 0x68, 0x20, 0x46,
-    0x6c, 0x6f, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x2a,
-    0x20, 0x42, 0x6f, 0x73, 0x74, 0x6f, 0x6e, 0x2c,
-    0x20, 0x4d, 0x41, 0x20, 0x30, 0x32, 0x31, 0x31,
-    0x30, 0x2d, 0x31, 0x33, 0x30, 0x31, 0x2c, 0x20,
-    0x55, 0x53, 0x41, 0x2e, 0x0a, 0x20, 0x2a, 0x2f,
-    0x0a,
-};
-
-/*
- * Sha1 IDS
- */
-static char *commit_id = "3d7f8a6af076c8c3f20071a8935cdbe8228594d1";
-static char *tree_id = "dff2da90b254e1beb889d1f1f1288be1803782df";
-static char *tag_id = "09d373e1dfdc16b129ceec6dd649739911541e05";
-static char *zero_id = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";
-static char *one_id = "8b137891791fe96927ad78e64b0aad7bded08bdc";
-static char *two_id = "78981922613b2afb6025042ff6bd878ac1994e85";
-static char *some_id = "fd8430bc864cfcd5f10e5590f8a447e01b942bfe";
-
-/*
- * In memory objects
- */
-static git_rawobj tree_obj = {
-	tree_data,
-	sizeof(tree_data),
-	GIT_OBJ_TREE
-};
-
-static git_rawobj tag_obj = {
-	tag_data,
-	sizeof(tag_data),
-	GIT_OBJ_TAG
-};
-
-static git_rawobj zero_obj = {
-	zero_data,
-	0,
-	GIT_OBJ_BLOB
-};
-
-static git_rawobj one_obj = {
-	one_data,
-	sizeof(one_data),
-	GIT_OBJ_BLOB
-};
-
-static git_rawobj two_obj = {
-	two_data,
-	sizeof(two_data),
-	GIT_OBJ_BLOB
-};
-
-static git_rawobj commit_obj = {
-	commit_data,
-	sizeof(commit_data),
-	GIT_OBJ_COMMIT
-};
-
-static git_rawobj some_obj = {
-	some_data,
-	sizeof(some_data),
-	GIT_OBJ_BLOB
-};
-
-static git_rawobj junk_obj = {
-	NULL,
-	0,
-	GIT_OBJ_BAD
-};
-
-
diff --git a/tests/t01-rawobj.c b/tests/t01-rawobj.c
deleted file mode 100644
index 2552085..0000000
--- a/tests/t01-rawobj.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-
-#include "odb.h"
-#include "hash.h"
-
-#include "t01-data.h"
-
-static int hash_object(git_oid *oid, git_rawobj *obj)
-{
-	return git_odb_hash(oid, obj->data, obj->len, obj->type);
-}
-
-BEGIN_TEST(oid0, "validate size of oid objects")
-	git_oid out;
-	must_be_true(20 == GIT_OID_RAWSZ);
-	must_be_true(40 == GIT_OID_HEXSZ);
-	must_be_true(sizeof(out) == GIT_OID_RAWSZ);
-	must_be_true(sizeof(out.id) == GIT_OID_RAWSZ);
-END_TEST
-
-BEGIN_TEST(oid1, "fail when parsing an empty string as oid")
-	git_oid out;
-	must_fail(git_oid_fromstr(&out, ""));
-END_TEST
-
-BEGIN_TEST(oid2, "fail when parsing an invalid string as oid")
-	git_oid out;
-	must_fail(git_oid_fromstr(&out, "moo"));
-END_TEST
-
-static int from_hex(unsigned int i)
-{
-	if (i >= '0' && i <= '9')
-		return i - '0';
-	if (i >= 'a' && i <= 'f')
-		return 10 + (i - 'a');
-	if (i >= 'A' && i <= 'F')
-		return 10 + (i - 'A');
-	return -1;
-}
-
-BEGIN_TEST(oid3, "find all invalid characters when parsing an oid")
-	git_oid out;
-	unsigned char exp[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xe0,
-	};
-	char in[41] = "16a67770b7d8d72317c4b775213c23a8bd74f5e0";
-	unsigned int i;
-
-	for (i = 0; i < 256; i++) {
-		in[38] = (char)i;
-
-		if (from_hex(i) >= 0) {
-			exp[19] = (unsigned char)(from_hex(i) << 4);
-			must_pass(git_oid_fromstr(&out, in));
-			must_be_true(memcmp(out.id, exp, sizeof(out.id)) == 0);
-		} else {
-			must_fail(git_oid_fromstr(&out, in));
-		}
-	}
-END_TEST
-
-BEGIN_TEST(oid4, "fail when parsing an invalid oid string")
-	git_oid out;
-	must_fail(git_oid_fromstr(&out, "16a67770b7d8d72317c4b775213c23a8bd74f5ez"));
-END_TEST
-
-BEGIN_TEST(oid5, "succeed when parsing a valid oid string")
-	git_oid out;
-	unsigned char exp[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xe0,
-	};
-
-	must_pass(git_oid_fromstr(&out, "16a67770b7d8d72317c4b775213c23a8bd74f5e0"));
-	must_pass(memcmp(out.id, exp, sizeof(out.id)));
-
-	must_pass(git_oid_fromstr(&out, "16A67770B7D8D72317C4b775213C23A8BD74F5E0"));
-	must_pass(memcmp(out.id, exp, sizeof(out.id)));
-END_TEST
-
-BEGIN_TEST(oid6, "build a valid oid from raw bytes")
-	git_oid out;
-	unsigned char exp[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xe0,
-	};
-
-	git_oid_fromraw(&out, exp);
-	must_pass(memcmp(out.id, exp, sizeof(out.id)));
-END_TEST
-
-BEGIN_TEST(oid7, "properly copy an oid to another")
-	git_oid a, b;
-	unsigned char exp[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xe0,
-	};
-
-	memset(&b, 0, sizeof(b));
-	git_oid_fromraw(&a, exp);
-	git_oid_cpy(&b, &a);
-	must_pass(memcmp(a.id, exp, sizeof(a.id)));
-END_TEST
-
-BEGIN_TEST(oid8, "compare two oids (lesser than)")
-	git_oid a, b;
-	unsigned char a_in[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xe0,
-	};
-	unsigned char b_in[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xf0,
-	};
-
-	git_oid_fromraw(&a, a_in);
-	git_oid_fromraw(&b, b_in);
-	must_be_true(git_oid_cmp(&a, &b) < 0);
-END_TEST
-
-BEGIN_TEST(oid9, "compare two oids (equal)")
-	git_oid a, b;
-	unsigned char a_in[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xe0,
-	};
-
-	git_oid_fromraw(&a, a_in);
-	git_oid_fromraw(&b, a_in);
-	must_be_true(git_oid_cmp(&a, &b) == 0);
-END_TEST
-
-BEGIN_TEST(oid10, "compare two oids (greater than)")
-	git_oid a, b;
-	unsigned char a_in[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xe0,
-	};
-	unsigned char b_in[] = {
-		0x16, 0xa6, 0x77, 0x70, 0xb7,
-		0xd8, 0xd7, 0x23, 0x17, 0xc4,
-		0xb7, 0x75, 0x21, 0x3c, 0x23,
-		0xa8, 0xbd, 0x74, 0xf5, 0xd0,
-	};
-
-	git_oid_fromraw(&a, a_in);
-	git_oid_fromraw(&b, b_in);
-	must_be_true(git_oid_cmp(&a, &b) > 0);
-END_TEST
-
-BEGIN_TEST(oid11, "compare formated oids")
-	const char *exp = "16a0123456789abcdef4b775213c23a8bd74f5e0";
-	git_oid in;
-	char out[GIT_OID_HEXSZ + 1];
-
-	must_pass(git_oid_fromstr(&in, exp));
-
-	/* Format doesn't touch the last byte */
-	out[GIT_OID_HEXSZ] = 'Z';
-	git_oid_fmt(out, &in);
-	must_be_true(out[GIT_OID_HEXSZ] == 'Z');
-
-	/* Format produced the right result */
-	out[GIT_OID_HEXSZ] = '\0';
-	must_be_true(strcmp(exp, out) == 0);
-END_TEST
-
-BEGIN_TEST(oid12, "compare oids (allocate + format)")
-	const char *exp = "16a0123456789abcdef4b775213c23a8bd74f5e0";
-	git_oid in;
-	char *out;
-
-	must_pass(git_oid_fromstr(&in, exp));
-
-	out = git_oid_allocfmt(&in);
-	must_be_true(out);
-	must_be_true(strcmp(exp, out) == 0);
-	free(out);
-END_TEST
-
-BEGIN_TEST(oid13, "compare oids (path format)")
-	const char *exp1 = "16a0123456789abcdef4b775213c23a8bd74f5e0";
-	const char *exp2 = "16/a0123456789abcdef4b775213c23a8bd74f5e0";
-	git_oid in;
-	char out[GIT_OID_HEXSZ + 2];
-
-	must_pass(git_oid_fromstr(&in, exp1));
-
-	/* Format doesn't touch the last byte */
-	out[GIT_OID_HEXSZ + 1] = 'Z';
-	git_oid_pathfmt(out, &in);
-	must_be_true(out[GIT_OID_HEXSZ + 1] == 'Z');
-
-	/* Format produced the right result */
-	out[GIT_OID_HEXSZ + 1] = '\0';
-	must_be_true(strcmp(exp2, out) == 0);
-END_TEST
-
-BEGIN_TEST(oid14, "convert raw oid to string")
-	const char *exp = "16a0123456789abcdef4b775213c23a8bd74f5e0";
-	git_oid in;
-	char out[GIT_OID_HEXSZ + 1];
-	char *str;
-	int i;
-
-	must_pass(git_oid_fromstr(&in, exp));
-
-	/* NULL buffer pointer, returns static empty string */
-	str = git_oid_to_string(NULL, sizeof(out), &in);
-	must_be_true(str && *str == '\0' && str != out);
-
-	/* zero buffer size, returns static empty string */
-	str = git_oid_to_string(out, 0, &in);
-	must_be_true(str && *str == '\0' && str != out);
-
-	/* NULL oid pointer, returns static empty string */
-	str = git_oid_to_string(out, sizeof(out), NULL);
-	must_be_true(str && *str == '\0' && str != out);
-
-	/* n == 1, returns out as an empty string */
-	str = git_oid_to_string(out, 1, &in);
-	must_be_true(str && *str == '\0' && str == out);
-
-	for (i = 1; i < GIT_OID_HEXSZ; i++) {
-		out[i+1] = 'Z';
-		str = git_oid_to_string(out, i+1, &in);
-		/* returns out containing c-string */
-		must_be_true(str && str == out);
-		/* must be '\0' terminated */
-		must_be_true(*(str+i) == '\0');
-		/* must not touch bytes past end of string */
-		must_be_true(*(str+(i+1)) == 'Z');
-		/* i == n-1 charaters of string */
-		must_pass(strncmp(exp, out, i));
-	}
-
-	/* returns out as hex formatted c-string */
-	str = git_oid_to_string(out, sizeof(out), &in);
-	must_be_true(str && str == out && *(str+GIT_OID_HEXSZ) == '\0');
-	must_be_true(strcmp(exp, out) == 0);
-END_TEST
-
-BEGIN_TEST(oid15, "convert raw oid to string (big)")
-	const char *exp = "16a0123456789abcdef4b775213c23a8bd74f5e0";
-	git_oid in;
-	char big[GIT_OID_HEXSZ + 1 + 3]; /* note + 4 => big buffer */
-	char *str;
-
-	must_pass(git_oid_fromstr(&in, exp));
-
-	/* place some tail material */
-	big[GIT_OID_HEXSZ+0] = 'W'; /* should be '\0' afterwards */
-	big[GIT_OID_HEXSZ+1] = 'X'; /* should remain untouched   */
-	big[GIT_OID_HEXSZ+2] = 'Y'; /* ditto */
-	big[GIT_OID_HEXSZ+3] = 'Z'; /* ditto */
-
-	/* returns big as hex formatted c-string */
-	str = git_oid_to_string(big, sizeof(big), &in);
-	must_be_true(str && str == big && *(str+GIT_OID_HEXSZ) == '\0');
-	must_be_true(strcmp(exp, big) == 0);
-
-	/* check tail material is untouched */
-	must_be_true(str && str == big && *(str+GIT_OID_HEXSZ+1) == 'X');
-	must_be_true(str && str == big && *(str+GIT_OID_HEXSZ+2) == 'Y');
-	must_be_true(str && str == big && *(str+GIT_OID_HEXSZ+3) == 'Z');
-END_TEST
-
-
-BEGIN_TEST(oid16, "make sure the OID shortener doesn't choke on duplicate sha1s")
-
-	git_oid_shorten *os;
-	int min_len;
-
-	os = git_oid_shorten_new(0);
-	must_be_true(os != NULL);
-
-	git_oid_shorten_add(os, "22596363b3de40b06f981fb85d82312e8c0ed511");
-	git_oid_shorten_add(os, "ce08fe4884650f067bd5703b6a59a8b3b3c99a09");
-	git_oid_shorten_add(os, "16a0123456789abcdef4b775213c23a8bd74f5e0");
-	min_len = git_oid_shorten_add(os, "ce08fe4884650f067bd5703b6a59a8b3b3c99a09");
-
-	must_be_true(min_len == GIT_OID_HEXSZ + 1);
-
-	git_oid_shorten_free(os);
-END_TEST
-
-BEGIN_TEST(oid17, "stress test for the git_oid_shorten object")
-
-#define MAX_OIDS 1000
-
-	git_oid_shorten *os;
-	char *oids[MAX_OIDS];
-	char number_buffer[16];
-	git_oid oid;
-	size_t i, j;
-
-	int min_len = 0, found_collision;
-
-	os = git_oid_shorten_new(0);
-	must_be_true(os != NULL);
-
-	/*
-	 * Insert in the shortener 1000 unique SHA1 ids
-	 */
-	for (i = 0; i < MAX_OIDS; ++i) {
-		char *oid_text;
-
-		sprintf(number_buffer, "%u", (unsigned int)i);
-		git_hash_buf(&oid, number_buffer, strlen(number_buffer));
-
-		oid_text = git__malloc(GIT_OID_HEXSZ + 1);
-		git_oid_fmt(oid_text, &oid);
-		oid_text[GIT_OID_HEXSZ] = 0;
-
-		min_len = git_oid_shorten_add(os, oid_text);
-		must_be_true(min_len >= 0);
-
-		oids[i] = oid_text;
-	}
-
-	/*
-	 * Compare the first `min_char - 1` characters of each
-	 * SHA1 OID. If the minimizer worked, we should find at
-	 * least one collision
-	 */
-	found_collision = 0;
-	for (i = 0; i < MAX_OIDS; ++i) {
-		for (j = 0; j < MAX_OIDS; ++j) {
-			if (i != j && memcmp(oids[i], oids[j], min_len - 1) == 0)
-				found_collision = 1;
-		}
-	}
-	must_be_true(found_collision == 1);
-
-	/*
-	 * Compare the first `min_char` characters of each
-	 * SHA1 OID. If the minimizer worked, every single preffix
-	 * should be unique.
-	 */
-	found_collision = 0;
-	for (i = 0; i < MAX_OIDS; ++i) {
-		for (j = 0; j < MAX_OIDS; ++j) {
-			if (i != j && memcmp(oids[i], oids[j], min_len) == 0)
-				found_collision = 1;
-		}
-	}
-	must_be_true(found_collision == 0);
-
-	/* cleanup */
-	for (i = 0; i < MAX_OIDS; ++i)
-		free(oids[i]);
-
-	git_oid_shorten_free(os);
-
-#undef MAX_OIDS
-END_TEST
-
-static char *hello_id = "22596363b3de40b06f981fb85d82312e8c0ed511";
-static char *hello_text = "hello world\n";
-
-static char *bye_id = "ce08fe4884650f067bd5703b6a59a8b3b3c99a09";
-static char *bye_text = "bye world\n";
-
-BEGIN_TEST(hash0, "normal hash by blocks")
-    git_hash_ctx *ctx;
-    git_oid id1, id2;
-
-    must_be_true((ctx = git_hash_new_ctx()) != NULL);
-
-	/* should already be init'd */
-    git_hash_update(ctx, hello_text, strlen(hello_text));
-    git_hash_final(&id2, ctx);
-    must_pass(git_oid_fromstr(&id1, hello_id));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-
-	/* reinit should permit reuse */
-    git_hash_init(ctx);
-    git_hash_update(ctx, bye_text, strlen(bye_text));
-    git_hash_final(&id2, ctx);
-    must_pass(git_oid_fromstr(&id1, bye_id));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-
-    git_hash_free_ctx(ctx);
-END_TEST
-
-BEGIN_TEST(hash1, "hash whole buffer in a single call")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, hello_id));
-
-    git_hash_buf(&id2, hello_text, strlen(hello_text));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(hash2, "hash a vector")
-    git_oid id1, id2;
-    git_buf_vec vec[2];
-
-    must_pass(git_oid_fromstr(&id1, hello_id));
-
-    vec[0].data = hello_text;
-    vec[0].len  = 4;
-    vec[1].data = hello_text+4;
-    vec[1].len  = strlen(hello_text)-4;
-
-    git_hash_vec(&id2, vec, 2);
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(objtype0, "convert type to string")
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ_BAD), ""));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ__EXT1), ""));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ_COMMIT), "commit"));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ_TREE), "tree"));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ_BLOB), "blob"));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ_TAG), "tag"));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ__EXT2), ""));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ_OFS_DELTA), "OFS_DELTA"));
-	must_be_true(!strcmp(git_object_type2string(GIT_OBJ_REF_DELTA), "REF_DELTA"));
-
-	must_be_true(!strcmp(git_object_type2string(-2), ""));
-	must_be_true(!strcmp(git_object_type2string(8), ""));
-	must_be_true(!strcmp(git_object_type2string(1234), ""));
-END_TEST
-
-BEGIN_TEST(objtype1, "convert string to type")
-	must_be_true(git_object_string2type(NULL) == GIT_OBJ_BAD);
-	must_be_true(git_object_string2type("") == GIT_OBJ_BAD);
-	must_be_true(git_object_string2type("commit") == GIT_OBJ_COMMIT);
-	must_be_true(git_object_string2type("tree") == GIT_OBJ_TREE);
-	must_be_true(git_object_string2type("blob") == GIT_OBJ_BLOB);
-	must_be_true(git_object_string2type("tag") == GIT_OBJ_TAG);
-	must_be_true(git_object_string2type("OFS_DELTA") == GIT_OBJ_OFS_DELTA);
-	must_be_true(git_object_string2type("REF_DELTA") == GIT_OBJ_REF_DELTA);
-
-	must_be_true(git_object_string2type("CoMmIt") == GIT_OBJ_BAD);
-	must_be_true(git_object_string2type("hohoho") == GIT_OBJ_BAD);
-END_TEST
-
-BEGIN_TEST(objtype2, "check if an object type is loose")
-	must_be_true(git_object_typeisloose(GIT_OBJ_BAD) == 0);
-	must_be_true(git_object_typeisloose(GIT_OBJ__EXT1) == 0);
-	must_be_true(git_object_typeisloose(GIT_OBJ_COMMIT) == 1);
-	must_be_true(git_object_typeisloose(GIT_OBJ_TREE) == 1);
-	must_be_true(git_object_typeisloose(GIT_OBJ_BLOB) == 1);
-	must_be_true(git_object_typeisloose(GIT_OBJ_TAG) == 1);
-	must_be_true(git_object_typeisloose(GIT_OBJ__EXT2) == 0);
-	must_be_true(git_object_typeisloose(GIT_OBJ_OFS_DELTA) == 0);
-	must_be_true(git_object_typeisloose(GIT_OBJ_REF_DELTA) == 0);
-
-	must_be_true(git_object_typeisloose(-2) == 0);
-	must_be_true(git_object_typeisloose(8) == 0);
-	must_be_true(git_object_typeisloose(1234) == 0);
-END_TEST
-
-BEGIN_TEST(objhash0, "hash junk data")
-    git_oid id, id_zero;
-
-    must_pass(git_oid_fromstr(&id_zero, zero_id));
-
-    /* invalid types: */
-    junk_obj.data = some_data;
-    must_fail(hash_object(&id, &junk_obj));
-
-    junk_obj.type = GIT_OBJ__EXT1;
-    must_fail(hash_object(&id, &junk_obj));
-
-    junk_obj.type = GIT_OBJ__EXT2;
-    must_fail(hash_object(&id, &junk_obj));
-
-    junk_obj.type = GIT_OBJ_OFS_DELTA;
-    must_fail(hash_object(&id, &junk_obj));
-
-    junk_obj.type = GIT_OBJ_REF_DELTA;
-    must_fail(hash_object(&id, &junk_obj));
-
-    /* data can be NULL only if len is zero: */
-    junk_obj.type = GIT_OBJ_BLOB;
-    junk_obj.data = NULL;
-    must_pass(hash_object(&id, &junk_obj));
-    must_be_true(git_oid_cmp(&id, &id_zero) == 0);
-
-    junk_obj.len = 1;
-    must_fail(hash_object(&id, &junk_obj));
-END_TEST
-
-BEGIN_TEST(objhash1, "hash a commit object")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, commit_id));
-
-    must_pass(hash_object(&id2, &commit_obj));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(objhash2, "hash a tree object")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, tree_id));
-
-    must_pass(hash_object(&id2, &tree_obj));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(objhash3, "hash a tag object")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, tag_id));
-
-    must_pass(hash_object(&id2, &tag_obj));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(objhash4, "hash a zero-length object")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, zero_id));
-
-    must_pass(hash_object(&id2, &zero_obj));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(objhash5, "hash an one-byte long object")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, one_id));
-
-    must_pass(hash_object(&id2, &one_obj));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(objhash6, "hash a two-byte long object")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, two_id));
-
-    must_pass(hash_object(&id2, &two_obj));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_TEST(objhash7, "hash an object several bytes long")
-    git_oid id1, id2;
-
-    must_pass(git_oid_fromstr(&id1, some_id));
-
-    must_pass(hash_object(&id2, &some_obj));
-
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-END_TEST
-
-BEGIN_SUITE(rawobjects)
-	ADD_TEST(oid0);
-	ADD_TEST(oid1);
-	ADD_TEST(oid2);
-	ADD_TEST(oid3);
-	ADD_TEST(oid4);
-	ADD_TEST(oid5);
-	ADD_TEST(oid6);
-	ADD_TEST(oid7);
-	ADD_TEST(oid8);
-	ADD_TEST(oid9);
-	ADD_TEST(oid10);
-	ADD_TEST(oid11);
-	ADD_TEST(oid12);
-	ADD_TEST(oid13);
-	ADD_TEST(oid14);
-	ADD_TEST(oid15);
-	ADD_TEST(oid16);
-	ADD_TEST(oid17);
-
-	ADD_TEST(hash0);
-	ADD_TEST(hash1);
-	ADD_TEST(hash2);
-
-	ADD_TEST(objtype0);
-	ADD_TEST(objtype1);
-	ADD_TEST(objtype2);
-
-	ADD_TEST(objhash0);
-	ADD_TEST(objhash1);
-	ADD_TEST(objhash2);
-	ADD_TEST(objhash3);
-	ADD_TEST(objhash4);
-	ADD_TEST(objhash5);
-	ADD_TEST(objhash6);
-	ADD_TEST(objhash7);
-END_SUITE
-
diff --git a/tests/t02-data.h b/tests/t02-data.h
deleted file mode 100644
index 705a2d7..0000000
--- a/tests/t02-data.h
+++ /dev/null
@@ -1,515 +0,0 @@
-
-static char *odb_dir = "test-objects";
-
-/* one == 8b137891791fe96927ad78e64b0aad7bded08bdc */
-static unsigned char one_bytes[] = {
-    0x31, 0x78, 0x9c, 0xe3, 0x02, 0x00, 0x00, 0x0b,
-    0x00, 0x0b,
-};
-
-static unsigned char one_data[] = {
-    0x0a,
-};
-
-static object_data one = {
-    one_bytes,
-    sizeof(one_bytes),
-    "8b137891791fe96927ad78e64b0aad7bded08bdc",
-    "blob",
-    "test-objects/8b",
-    "test-objects/8b/137891791fe96927ad78e64b0aad7bded08bdc",
-    one_data,
-    sizeof(one_data),
-};
-
-
-/* commit == 3d7f8a6af076c8c3f20071a8935cdbe8228594d1 */
-static unsigned char commit_bytes[] = {
-    0x78, 0x01, 0x85, 0x50, 0xc1, 0x6a, 0xc3, 0x30,
-    0x0c, 0xdd, 0xd9, 0x5f, 0xa1, 0xfb, 0x96, 0x12,
-    0xbb, 0x29, 0x71, 0x46, 0x19, 0x2b, 0x3d, 0x97,
-    0x1d, 0xd6, 0x7d, 0x80, 0x1d, 0xcb, 0x89, 0x21,
-    0xb6, 0x82, 0xed, 0x40, 0xf3, 0xf7, 0xf3, 0x48,
-    0x29, 0x3b, 0x6d, 0xd2, 0xe5, 0xbd, 0x27, 0xbd,
-    0x27, 0x50, 0x4f, 0xde, 0xbb, 0x0c, 0xfb, 0x43,
-    0xf3, 0x94, 0x23, 0x22, 0x18, 0x6b, 0x85, 0x51,
-    0x5d, 0xad, 0xc5, 0xa1, 0x41, 0xae, 0x51, 0x4b,
-    0xd9, 0x19, 0x6e, 0x4b, 0x0b, 0x29, 0x35, 0x72,
-    0x59, 0xef, 0x5b, 0x29, 0x8c, 0x65, 0x6a, 0xc9,
-    0x23, 0x45, 0x38, 0xc1, 0x17, 0x5c, 0x7f, 0xc0,
-    0x71, 0x13, 0xde, 0xf1, 0xa6, 0xfc, 0x3c, 0xe1,
-    0xae, 0x27, 0xff, 0x06, 0x5c, 0x88, 0x56, 0xf2,
-    0x46, 0x74, 0x2d, 0x3c, 0xd7, 0xa5, 0x58, 0x51,
-    0xcb, 0xb9, 0x8c, 0x11, 0xce, 0xf0, 0x01, 0x97,
-    0x0d, 0x1e, 0x1f, 0xea, 0x3f, 0x6e, 0x76, 0x02,
-    0x0a, 0x58, 0x4d, 0x2e, 0x20, 0x6c, 0x1e, 0x48,
-    0x8b, 0xf7, 0x2a, 0xae, 0x8c, 0x5d, 0x47, 0x04,
-    0x4d, 0x66, 0x05, 0xb2, 0x90, 0x0b, 0xbe, 0xcf,
-    0x3d, 0xa6, 0xa4, 0x06, 0x7c, 0x29, 0x3c, 0x64,
-    0xe5, 0x82, 0x0b, 0x03, 0xd8, 0x25, 0x96, 0x8d,
-    0x08, 0x78, 0x9b, 0x27, 0x15, 0x54, 0x76, 0x14,
-    0xd8, 0xdd, 0x35, 0x2f, 0x71, 0xa6, 0x84, 0x8f,
-    0x90, 0x51, 0x85, 0x01, 0x13, 0xb8, 0x90, 0x23,
-    0x99, 0xa5, 0x47, 0x03, 0x7a, 0xfd, 0x15, 0xbf,
-    0x63, 0xec, 0xd3, 0x0d, 0x01, 0x4d, 0x45, 0xb6,
-    0xd2, 0xeb, 0xeb, 0xdf, 0xef, 0x60, 0xdf, 0xef,
-    0x1f, 0x78, 0x35,
-};
-
-static unsigned char commit_data[] = {
-    0x74, 0x72, 0x65, 0x65, 0x20, 0x64, 0x66, 0x66,
-    0x32, 0x64, 0x61, 0x39, 0x30, 0x62, 0x32, 0x35,
-    0x34, 0x65, 0x31, 0x62, 0x65, 0x62, 0x38, 0x38,
-    0x39, 0x64, 0x31, 0x66, 0x31, 0x66, 0x31, 0x32,
-    0x38, 0x38, 0x62, 0x65, 0x31, 0x38, 0x30, 0x33,
-    0x37, 0x38, 0x32, 0x64, 0x66, 0x0a, 0x61, 0x75,
-    0x74, 0x68, 0x6f, 0x72, 0x20, 0x41, 0x20, 0x55,
-    0x20, 0x54, 0x68, 0x6f, 0x72, 0x20, 0x3c, 0x61,
-    0x75, 0x74, 0x68, 0x6f, 0x72, 0x40, 0x65, 0x78,
-    0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
-    0x6d, 0x3e, 0x20, 0x31, 0x32, 0x32, 0x37, 0x38,
-    0x31, 0x34, 0x32, 0x39, 0x37, 0x20, 0x2b, 0x30,
-    0x30, 0x30, 0x30, 0x0a, 0x63, 0x6f, 0x6d, 0x6d,
-    0x69, 0x74, 0x74, 0x65, 0x72, 0x20, 0x43, 0x20,
-    0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74, 0x65, 0x72,
-    0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
-    0x74, 0x65, 0x72, 0x40, 0x65, 0x78, 0x61, 0x6d,
-    0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x3e,
-    0x20, 0x31, 0x32, 0x32, 0x37, 0x38, 0x31, 0x34,
-    0x32, 0x39, 0x37, 0x20, 0x2b, 0x30, 0x30, 0x30,
-    0x30, 0x0a, 0x0a, 0x41, 0x20, 0x6f, 0x6e, 0x65,
-    0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x6d, 0x69, 0x74, 0x20, 0x73, 0x75, 0x6d,
-    0x6d, 0x61, 0x72, 0x79, 0x0a, 0x0a, 0x54, 0x68,
-    0x65, 0x20, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x6f,
-    0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x6d, 0x69, 0x74, 0x20, 0x6d, 0x65, 0x73,
-    0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x63, 0x6f,
-    0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67,
-    0x20, 0x66, 0x75, 0x72, 0x74, 0x68, 0x65, 0x72,
-    0x20, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61,
-    0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x6f, 0x66, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x72, 0x70,
-    0x6f, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67,
-    0x65, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f,
-    0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d,
-    0x6d, 0x69, 0x74, 0x2e, 0x0a, 0x0a, 0x53, 0x69,
-    0x67, 0x6e, 0x65, 0x64, 0x2d, 0x6f, 0x66, 0x2d,
-    0x62, 0x79, 0x3a, 0x20, 0x41, 0x20, 0x55, 0x20,
-    0x54, 0x68, 0x6f, 0x72, 0x20, 0x3c, 0x61, 0x75,
-    0x74, 0x68, 0x6f, 0x72, 0x40, 0x65, 0x78, 0x61,
-    0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
-    0x3e, 0x0a,
-};
-
-static object_data commit = {
-    commit_bytes,
-    sizeof(commit_bytes),
-    "3d7f8a6af076c8c3f20071a8935cdbe8228594d1",
-    "commit",
-    "test-objects/3d",
-    "test-objects/3d/7f8a6af076c8c3f20071a8935cdbe8228594d1",
-    commit_data,
-    sizeof(commit_data),
-};
-
-/* tree == dff2da90b254e1beb889d1f1f1288be1803782df */
-static unsigned char tree_bytes[] = {
-    0x78, 0x01, 0x2b, 0x29, 0x4a, 0x4d, 0x55, 0x30,
-    0x34, 0x32, 0x63, 0x30, 0x34, 0x30, 0x30, 0x33,
-    0x31, 0x51, 0xc8, 0xcf, 0x4b, 0x65, 0xe8, 0x16,
-    0xae, 0x98, 0x58, 0x29, 0xff, 0x32, 0x53, 0x7d,
-    0x6d, 0xc5, 0x33, 0x6f, 0xae, 0xb5, 0xd5, 0xf7,
-    0x2e, 0x74, 0xdf, 0x81, 0x4a, 0x17, 0xe7, 0xe7,
-    0xa6, 0x32, 0xfc, 0x6d, 0x31, 0xd8, 0xd3, 0xe6,
-    0xf3, 0xe7, 0xea, 0x47, 0xbe, 0xd0, 0x09, 0x3f,
-    0x96, 0xb8, 0x3f, 0x90, 0x9e, 0xa2, 0xfd, 0x0f,
-    0x2a, 0x5f, 0x52, 0x9e, 0xcf, 0x50, 0x31, 0x43,
-    0x52, 0x29, 0xd1, 0x5a, 0xeb, 0x77, 0x82, 0x2a,
-    0x8b, 0xfe, 0xb7, 0xbd, 0xed, 0x5d, 0x07, 0x67,
-    0xfa, 0xb5, 0x42, 0xa5, 0xab, 0x52, 0x8b, 0xf2,
-    0x19, 0x9e, 0xcd, 0x7d, 0x34, 0x7b, 0xd3, 0xc5,
-    0x6b, 0xce, 0xde, 0xdd, 0x9a, 0xeb, 0xca, 0xa3,
-    0x6e, 0x1c, 0x7a, 0xd2, 0x13, 0x3c, 0x11, 0x00,
-    0xe2, 0xaa, 0x38, 0x57,
-};
-
-static unsigned char tree_data[] = {
-    0x31, 0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x6f,
-    0x6e, 0x65, 0x00, 0x8b, 0x13, 0x78, 0x91, 0x79,
-    0x1f, 0xe9, 0x69, 0x27, 0xad, 0x78, 0xe6, 0x4b,
-    0x0a, 0xad, 0x7b, 0xde, 0xd0, 0x8b, 0xdc, 0x31,
-    0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x73, 0x6f,
-    0x6d, 0x65, 0x00, 0xfd, 0x84, 0x30, 0xbc, 0x86,
-    0x4c, 0xfc, 0xd5, 0xf1, 0x0e, 0x55, 0x90, 0xf8,
-    0xa4, 0x47, 0xe0, 0x1b, 0x94, 0x2b, 0xfe, 0x31,
-    0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x74, 0x77,
-    0x6f, 0x00, 0x78, 0x98, 0x19, 0x22, 0x61, 0x3b,
-    0x2a, 0xfb, 0x60, 0x25, 0x04, 0x2f, 0xf6, 0xbd,
-    0x87, 0x8a, 0xc1, 0x99, 0x4e, 0x85, 0x31, 0x30,
-    0x30, 0x36, 0x34, 0x34, 0x20, 0x7a, 0x65, 0x72,
-    0x6f, 0x00, 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1,
-    0xd6, 0x43, 0x4b, 0x8b, 0x29, 0xae, 0x77, 0x5a,
-    0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91,
-};
-
-static object_data tree = {
-    tree_bytes,
-    sizeof(tree_bytes),
-    "dff2da90b254e1beb889d1f1f1288be1803782df",
-    "tree",
-    "test-objects/df",
-    "test-objects/df/f2da90b254e1beb889d1f1f1288be1803782df",
-    tree_data,
-    sizeof(tree_data),
-};
-
-/* tag == 09d373e1dfdc16b129ceec6dd649739911541e05 */
-static unsigned char tag_bytes[] = {
-    0x78, 0x01, 0x35, 0x4e, 0xcb, 0x0a, 0xc2, 0x40,
-    0x10, 0xf3, 0xbc, 0x5f, 0x31, 0x77, 0xa1, 0xec,
-    0xa3, 0xed, 0x6e, 0x41, 0x44, 0xf0, 0x2c, 0x5e,
-    0xfc, 0x81, 0xe9, 0x76, 0xb6, 0xad, 0xb4, 0xb4,
-    0x6c, 0x07, 0xd1, 0xbf, 0x77, 0x44, 0x0d, 0x39,
-    0x84, 0x10, 0x92, 0x30, 0xf6, 0x60, 0xbc, 0xdb,
-    0x2d, 0xed, 0x9d, 0x22, 0x83, 0xeb, 0x7c, 0x0a,
-    0x58, 0x63, 0xd2, 0xbe, 0x8e, 0x21, 0xba, 0x64,
-    0xb5, 0xf6, 0x06, 0x43, 0xe3, 0xaa, 0xd8, 0xb5,
-    0x14, 0xac, 0x0d, 0x55, 0x53, 0x76, 0x46, 0xf1,
-    0x6b, 0x25, 0x88, 0xcb, 0x3c, 0x8f, 0xac, 0x58,
-    0x3a, 0x1e, 0xba, 0xd0, 0x85, 0xd8, 0xd8, 0xf7,
-    0x94, 0xe1, 0x0c, 0x57, 0xb8, 0x8c, 0xcc, 0x22,
-    0x0f, 0xdf, 0x90, 0xc8, 0x13, 0x3d, 0x71, 0x5e,
-    0x27, 0x2a, 0xc4, 0x39, 0x82, 0xb1, 0xd6, 0x07,
-    0x53, 0xda, 0xc6, 0xc3, 0x5e, 0x0b, 0x94, 0xba,
-    0x0d, 0xe3, 0x06, 0x42, 0x1e, 0x08, 0x3e, 0x95,
-    0xbf, 0x4b, 0x69, 0xc9, 0x90, 0x69, 0x22, 0xdc,
-    0xe8, 0xbf, 0xf2, 0x06, 0x42, 0x9a, 0x36, 0xb1,
-};
-
-static unsigned char tag_data[] = {
-    0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x33,
-    0x64, 0x37, 0x66, 0x38, 0x61, 0x36, 0x61, 0x66,
-    0x30, 0x37, 0x36, 0x63, 0x38, 0x63, 0x33, 0x66,
-    0x32, 0x30, 0x30, 0x37, 0x31, 0x61, 0x38, 0x39,
-    0x33, 0x35, 0x63, 0x64, 0x62, 0x65, 0x38, 0x32,
-    0x32, 0x38, 0x35, 0x39, 0x34, 0x64, 0x31, 0x0a,
-    0x74, 0x79, 0x70, 0x65, 0x20, 0x63, 0x6f, 0x6d,
-    0x6d, 0x69, 0x74, 0x0a, 0x74, 0x61, 0x67, 0x20,
-    0x76, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x0a, 0x74,
-    0x61, 0x67, 0x67, 0x65, 0x72, 0x20, 0x43, 0x20,
-    0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74, 0x65, 0x72,
-    0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
-    0x74, 0x65, 0x72, 0x40, 0x65, 0x78, 0x61, 0x6d,
-    0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x3e,
-    0x20, 0x31, 0x32, 0x32, 0x37, 0x38, 0x31, 0x34,
-    0x32, 0x39, 0x37, 0x20, 0x2b, 0x30, 0x30, 0x30,
-    0x30, 0x0a, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20,
-    0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,
-    0x61, 0x67, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63,
-    0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65,
-    0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x76, 0x30,
-    0x2e, 0x30, 0x2e, 0x31, 0x0a,
-};
-
-static object_data tag = {
-    tag_bytes,
-    sizeof(tag_bytes),
-    "09d373e1dfdc16b129ceec6dd649739911541e05",
-    "tag",
-    "test-objects/09",
-    "test-objects/09/d373e1dfdc16b129ceec6dd649739911541e05",
-    tag_data,
-    sizeof(tag_data),
-};
-
-/* zero == e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 */
-static unsigned char zero_bytes[] = {
-    0x78, 0x01, 0x4b, 0xca, 0xc9, 0x4f, 0x52, 0x30,
-    0x60, 0x00, 0x00, 0x09, 0xb0, 0x01, 0xf0,
-};
-
-static unsigned char zero_data[] = {
-    0x00  /* dummy data */
-};
-
-static object_data zero = {
-    zero_bytes,
-    sizeof(zero_bytes),
-    "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
-    "blob",
-    "test-objects/e6",
-    "test-objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391",
-    zero_data,
-    0,
-};
-
-/* two == 78981922613b2afb6025042ff6bd878ac1994e85 */
-static unsigned char two_bytes[] = {
-    0x78, 0x01, 0x4b, 0xca, 0xc9, 0x4f, 0x52, 0x30,
-    0x62, 0x48, 0xe4, 0x02, 0x00, 0x0e, 0x64, 0x02,
-    0x5d,
-};
-
-static unsigned char two_data[] = {
-    0x61, 0x0a,
-};
-
-static object_data two = {
-    two_bytes,
-    sizeof(two_bytes),
-    "78981922613b2afb6025042ff6bd878ac1994e85",
-    "blob",
-    "test-objects/78",
-    "test-objects/78/981922613b2afb6025042ff6bd878ac1994e85",
-    two_data,
-    sizeof(two_data),
-};
-
-/* some == fd8430bc864cfcd5f10e5590f8a447e01b942bfe */
-static unsigned char some_bytes[] = {
-    0x78, 0x01, 0x7d, 0x54, 0xc1, 0x4e, 0xe3, 0x30,
-    0x10, 0xdd, 0x33, 0x5f, 0x31, 0xc7, 0x5d, 0x94,
-    0xa5, 0x84, 0xd5, 0x22, 0xad, 0x7a, 0x0a, 0x15,
-    0x85, 0x48, 0xd0, 0x56, 0x49, 0x2a, 0xd4, 0xa3,
-    0x13, 0x4f, 0x88, 0x85, 0x63, 0x47, 0xb6, 0x43,
-    0xc9, 0xdf, 0xef, 0x8c, 0x69, 0x17, 0x56, 0x0b,
-    0x7b, 0xaa, 0x62, 0x7b, 0xde, 0xbc, 0xf7, 0xe6,
-    0x4d, 0x6b, 0x6d, 0x6b, 0x48, 0xd3, 0xcb, 0x5f,
-    0x5f, 0x66, 0xa7, 0x27, 0x70, 0x0a, 0x55, 0xa7,
-    0x3c, 0xb4, 0x4a, 0x23, 0xf0, 0xaf, 0x43, 0x04,
-    0x6f, 0xdb, 0xb0, 0x17, 0x0e, 0xe7, 0x30, 0xd9,
-    0x11, 0x1a, 0x61, 0xc0, 0xa1, 0x54, 0x3e, 0x38,
-    0x55, 0x8f, 0x81, 0x9e, 0x05, 0x10, 0x46, 0xce,
-    0xac, 0x83, 0xde, 0x4a, 0xd5, 0x4e, 0x0c, 0x42,
-    0x67, 0xa3, 0x91, 0xe8, 0x20, 0x74, 0x08, 0x01,
-    0x5d, 0xef, 0xc1, 0xb6, 0xf1, 0xe3, 0x66, 0xb5,
-    0x85, 0x1b, 0x34, 0xe8, 0x84, 0x86, 0xcd, 0x58,
-    0x6b, 0xd5, 0xc0, 0x9d, 0x6a, 0xd0, 0x78, 0x4c,
-    0xe0, 0x19, 0x9d, 0x57, 0xd6, 0xc0, 0x45, 0xc2,
-    0x18, 0xc2, 0xc3, 0xc0, 0x0f, 0x7c, 0x87, 0x12,
-    0xea, 0x29, 0x56, 0x2f, 0x99, 0x4f, 0x79, 0xe0,
-    0x03, 0x4b, 0x4b, 0x4d, 0x44, 0xa0, 0x92, 0x33,
-    0x2a, 0xe0, 0x9a, 0xdc, 0x80, 0x90, 0x52, 0xf1,
-    0x11, 0x04, 0x1b, 0x4b, 0x06, 0xea, 0xae, 0x3c,
-    0xe3, 0x7a, 0x50, 0x74, 0x4a, 0x84, 0xfe, 0xc3,
-    0x81, 0x41, 0xf8, 0x89, 0x18, 0x43, 0x67, 0x9d,
-    0x87, 0x47, 0xf5, 0x8c, 0x51, 0xf6, 0x68, 0xb4,
-    0xea, 0x55, 0x20, 0x2a, 0x6f, 0x80, 0xdc, 0x42,
-    0x2b, 0xf3, 0x14, 0x2b, 0x1a, 0xdb, 0x0f, 0xe4,
-    0x9a, 0x64, 0x84, 0xa3, 0x90, 0xa8, 0xf9, 0x8f,
-    0x9d, 0x86, 0x9e, 0xd3, 0xab, 0x5a, 0x99, 0xc8,
-    0xd9, 0xc3, 0x5e, 0x85, 0x0e, 0x2c, 0xb5, 0x73,
-    0x30, 0x38, 0xfb, 0xe8, 0x44, 0xef, 0x5f, 0x95,
-    0x1b, 0xc9, 0xd0, 0xef, 0x3c, 0x26, 0x32, 0x1e,
-    0xff, 0x2d, 0xb6, 0x23, 0x7b, 0x3f, 0xd1, 0x3c,
-    0x78, 0x1a, 0x0d, 0xcb, 0xe6, 0xf6, 0xd4, 0x44,
-    0x99, 0x47, 0x1a, 0x9e, 0xed, 0x23, 0xb5, 0x91,
-    0x6a, 0xdf, 0x53, 0x39, 0x03, 0xf8, 0x5a, 0xb1,
-    0x0f, 0x1f, 0xce, 0x81, 0x11, 0xde, 0x01, 0x7a,
-    0x90, 0x16, 0xc4, 0x30, 0xe8, 0x89, 0xed, 0x7b,
-    0x65, 0x4b, 0xd7, 0x03, 0x36, 0xc1, 0xcf, 0xa1,
-    0xa5, 0xb1, 0xe3, 0x8b, 0xe8, 0x07, 0x4d, 0xf3,
-    0x23, 0x25, 0x13, 0x35, 0x27, 0xf5, 0x8c, 0x11,
-    0xd3, 0xa0, 0x9a, 0xa8, 0xf5, 0x38, 0x7d, 0xce,
-    0x55, 0xc2, 0x71, 0x79, 0x13, 0xc7, 0xa3, 0xda,
-    0x77, 0x68, 0xc0, 0xd8, 0x10, 0xdd, 0x24, 0x8b,
-    0x15, 0x59, 0xc5, 0x10, 0xe2, 0x20, 0x99, 0x8e,
-    0xf0, 0x05, 0x9b, 0x31, 0x88, 0x5a, 0xe3, 0xd9,
-    0x37, 0xba, 0xe2, 0xdb, 0xbf, 0x92, 0xfa, 0x66,
-    0x16, 0x97, 0x47, 0xd9, 0x9d, 0x1d, 0x28, 0x7c,
-    0x9d, 0x08, 0x1c, 0xc7, 0xbd, 0xd2, 0x1a, 0x6a,
-    0x04, 0xf2, 0xa2, 0x1d, 0x75, 0x02, 0x14, 0x5d,
-    0xc6, 0x78, 0xc8, 0xab, 0xdb, 0xf5, 0xb6, 0x82,
-    0x6c, 0xb5, 0x83, 0x87, 0xac, 0x28, 0xb2, 0x55,
-    0xb5, 0x9b, 0xc7, 0xc1, 0xb0, 0xb7, 0xf8, 0x4c,
-    0xbc, 0x38, 0x0e, 0x8a, 0x04, 0x2a, 0x62, 0x41,
-    0x6b, 0xe0, 0x84, 0x09, 0x13, 0xe9, 0xe1, 0xea,
-    0xfb, 0xeb, 0x62, 0x71, 0x4b, 0x25, 0xd9, 0x55,
-    0x7e, 0x97, 0x57, 0x3b, 0x20, 0x33, 0x96, 0x79,
-    0xb5, 0xba, 0x2e, 0x4b, 0x58, 0xae, 0x0b, 0xc8,
-    0x60, 0x93, 0x15, 0x55, 0xbe, 0xd8, 0xde, 0x65,
-    0x05, 0x6c, 0xb6, 0xc5, 0x66, 0x5d, 0x5e, 0x93,
-    0xf7, 0x25, 0x65, 0x98, 0x41, 0x29, 0x86, 0x0c,
-    0xf2, 0xf1, 0x14, 0xa2, 0xb3, 0xbd, 0x75, 0x08,
-    0x12, 0x83, 0x50, 0xda, 0x1f, 0x23, 0xbe, 0xa3,
-    0x1d, 0xf4, 0x9d, 0x1d, 0xb5, 0x84, 0x4e, 0x50,
-    0x38, 0x1d, 0x36, 0x48, 0x21, 0x95, 0xd1, 0xac,
-    0x81, 0x99, 0x1d, 0xc1, 0x3f, 0x41, 0xe6, 0x9e,
-    0x42, 0x5b, 0x0a, 0x48, 0xcc, 0x5f, 0xe0, 0x7d,
-    0x3f, 0xc4, 0x6f, 0x0e, 0xfe, 0xc0, 0x2d, 0xfe,
-    0x01, 0x2c, 0xd6, 0x9b, 0x5d, 0xbe, 0xba, 0x21,
-    0xca, 0x79, 0xcb, 0xe3, 0x49, 0x60, 0xef, 0x68,
-    0x05, 0x28, 0x9b, 0x8c, 0xc1, 0x12, 0x3e, 0xdb,
-    0xc7, 0x04, 0x7e, 0xa6, 0x74, 0x29, 0xcc, 0x13,
-    0xed, 0x07, 0x94, 0x81, 0xd6, 0x96, 0xaa, 0x97,
-    0xaa, 0xa5, 0xc0, 0x2f, 0xb5, 0xb5, 0x2e, 0xe6,
-    0xfc, 0xca, 0xfa, 0x60, 0x4d, 0x02, 0xf7, 0x19,
-    0x9c, 0x5f, 0xa4, 0xe9, 0xf9, 0xf7, 0xf4, 0xc7,
-    0x79, 0x9a, 0xc0, 0xb6, 0xcc, 0x58, 0xec, 0xec,
-    0xe4, 0x37, 0x22, 0xfa, 0x8b, 0x53,
-};
-
-static unsigned char some_data[] = {
-    0x2f, 0x2a, 0x0a, 0x20, 0x2a, 0x20, 0x54, 0x68,
-    0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20,
-    0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20,
-    0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x3b, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61,
-    0x6e, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74,
-    0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x69,
-    0x74, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72,
-    0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x0a,
-    0x20, 0x2a, 0x20, 0x69, 0x74, 0x20, 0x75, 0x6e,
-    0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c,
-    0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
-    0x20, 0x32, 0x2c, 0x0a, 0x20, 0x2a, 0x20, 0x61,
-    0x73, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
-    0x68, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20,
-    0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x2a, 0x0a,
-    0x20, 0x2a, 0x20, 0x49, 0x6e, 0x20, 0x61, 0x64,
-    0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74,
-    0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x65,
-    0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
-    0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,
-    0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x65, 0x6e,
-    0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62,
-    0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65,
-    0x6e, 0x73, 0x65, 0x2c, 0x0a, 0x20, 0x2a, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x61, 0x75, 0x74, 0x68,
-    0x6f, 0x72, 0x73, 0x20, 0x67, 0x69, 0x76, 0x65,
-    0x20, 0x79, 0x6f, 0x75, 0x20, 0x75, 0x6e, 0x6c,
-    0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x70,
-    0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
-    0x6e, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x6e,
-    0x6b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x0a, 0x20,
-    0x2a, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
-    0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69,
-    0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x69,
-    0x6e, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x62,
-    0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
-    0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6f, 0x74,
-    0x68, 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67,
-    0x72, 0x61, 0x6d, 0x73, 0x2c, 0x0a, 0x20, 0x2a,
-    0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20,
-    0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75,
-    0x74, 0x65, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65,
-    0x20, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61,
-    0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69,
-    0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x6e,
-    0x79, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69,
-    0x63, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x2a,
-    0x20, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x20,
-    0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65,
-    0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20,
-    0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c,
-    0x65, 0x2e, 0x20, 0x20, 0x28, 0x54, 0x68, 0x65,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a,
-    0x20, 0x2a, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72,
-    0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,
-    0x64, 0x6f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79,
-    0x20, 0x69, 0x6e, 0x20, 0x6f, 0x74, 0x68, 0x65,
-    0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63,
-    0x74, 0x73, 0x3b, 0x20, 0x66, 0x6f, 0x72, 0x20,
-    0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c,
-    0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x63, 0x6f,
-    0x76, 0x65, 0x72, 0x0a, 0x20, 0x2a, 0x20, 0x6d,
-    0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c,
-    0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x73,
-    0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f,
-    0x6e, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6e,
-    0x6f, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x6b, 0x65,
-    0x64, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x0a, 0x20,
-    0x2a, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x62,
-    0x69, 0x6e, 0x65, 0x64, 0x20, 0x65, 0x78, 0x65,
-    0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e,
-    0x29, 0x0a, 0x20, 0x2a, 0x0a, 0x20, 0x2a, 0x20,
-    0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c,
-    0x65, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73,
-    0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64,
-    0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x68, 0x6f, 0x70, 0x65, 0x20, 0x74, 0x68, 0x61,
-    0x74, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c,
-    0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65,
-    0x66, 0x75, 0x6c, 0x2c, 0x20, 0x62, 0x75, 0x74,
-    0x0a, 0x20, 0x2a, 0x20, 0x57, 0x49, 0x54, 0x48,
-    0x4f, 0x55, 0x54, 0x20, 0x41, 0x4e, 0x59, 0x20,
-    0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59,
-    0x3b, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75,
-    0x74, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69,
-    0x65, 0x64, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61,
-    0x6e, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x0a, 0x20,
-    0x2a, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41,
-    0x4e, 0x54, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54,
-    0x59, 0x20, 0x6f, 0x72, 0x20, 0x46, 0x49, 0x54,
-    0x4e, 0x45, 0x53, 0x53, 0x20, 0x46, 0x4f, 0x52,
-    0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49,
-    0x43, 0x55, 0x4c, 0x41, 0x52, 0x20, 0x50, 0x55,
-    0x52, 0x50, 0x4f, 0x53, 0x45, 0x2e, 0x20, 0x20,
-    0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x47, 0x4e, 0x55, 0x0a, 0x20, 0x2a, 0x20, 0x47,
-    0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50,
-    0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69,
-    0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x66, 0x6f,
-    0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x64,
-    0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x0a,
-    0x20, 0x2a, 0x0a, 0x20, 0x2a, 0x20, 0x59, 0x6f,
-    0x75, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,
-    0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, 0x65,
-    0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x61,
-    0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a,
-    0x20, 0x2a, 0x20, 0x61, 0x6c, 0x6f, 0x6e, 0x67,
-    0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68,
-    0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72,
-    0x61, 0x6d, 0x3b, 0x20, 0x73, 0x65, 0x65, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65,
-    0x20, 0x43, 0x4f, 0x50, 0x59, 0x49, 0x4e, 0x47,
-    0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f,
-    0x74, 0x2c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65,
-    0x20, 0x74, 0x6f, 0x0a, 0x20, 0x2a, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20,
-    0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x35, 0x31, 0x20,
-    0x46, 0x72, 0x61, 0x6e, 0x6b, 0x6c, 0x69, 0x6e,
-    0x20, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74, 0x2c,
-    0x20, 0x46, 0x69, 0x66, 0x74, 0x68, 0x20, 0x46,
-    0x6c, 0x6f, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x2a,
-    0x20, 0x42, 0x6f, 0x73, 0x74, 0x6f, 0x6e, 0x2c,
-    0x20, 0x4d, 0x41, 0x20, 0x30, 0x32, 0x31, 0x31,
-    0x30, 0x2d, 0x31, 0x33, 0x30, 0x31, 0x2c, 0x20,
-    0x55, 0x53, 0x41, 0x2e, 0x0a, 0x20, 0x2a, 0x2f,
-    0x0a,
-};
-
-static object_data some = {
-    some_bytes,
-    sizeof(some_bytes),
-    "fd8430bc864cfcd5f10e5590f8a447e01b942bfe",
-    "blob",
-    "test-objects/fd",
-    "test-objects/fd/8430bc864cfcd5f10e5590f8a447e01b942bfe",
-    some_data,
-    sizeof(some_data),
-};
-
diff --git a/tests/t02-objread.c b/tests/t02-objread.c
deleted file mode 100644
index 4bcff27..0000000
--- a/tests/t02-objread.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-#include "odb.h"
-
-#include "t02-data.h"
-#include "t02-oids.h"
-
-
-BEGIN_TEST(existsloose0, "check if a loose object exists on the odb")
-    git_odb *db;
-    git_oid id, id2;
-
-    must_pass(write_object_files(odb_dir, &one));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, one.id));
-
-    must_be_true(git_odb_exists(db, &id));
-
-	/* Test for a non-existant object */
-    must_pass(git_oid_fromstr(&id2, "8b137891791fe96927ad78e64b0aad7bded08baa"));
-    must_be_true(0 == git_odb_exists(db, &id2));
-
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &one));
-END_TEST
-
-BEGIN_TEST(readloose0, "read a loose commit")
-    git_odb *db;
-    git_oid id;
-    git_odb_object *obj;
-
-    must_pass(write_object_files(odb_dir, &commit));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, commit.id));
-
-    must_pass(git_odb_read(&obj, db, &id));
-    must_pass(cmp_objects((git_rawobj *)&obj->raw, &commit));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &commit));
-END_TEST
-
-BEGIN_TEST(readloose1, "read a loose tree")
-    git_odb *db;
-    git_oid id;
-    git_odb_object *obj;
-
-    must_pass(write_object_files(odb_dir, &tree));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, tree.id));
-
-    must_pass(git_odb_read(&obj, db, &id));
-    must_pass(cmp_objects((git_rawobj *)&obj->raw, &tree));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &tree));
-END_TEST
-
-BEGIN_TEST(readloose2, "read a loose tag")
-    git_odb *db;
-    git_oid id;
-    git_odb_object *obj;
-
-    must_pass(write_object_files(odb_dir, &tag));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, tag.id));
-
-    must_pass(git_odb_read(&obj, db, &id));
-    must_pass(cmp_objects((git_rawobj *)&obj->raw, &tag));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &tag));
-END_TEST
-
-BEGIN_TEST(readloose3, "read a loose zero-bytes object")
-    git_odb *db;
-    git_oid id;
-    git_odb_object *obj;
-
-    must_pass(write_object_files(odb_dir, &zero));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, zero.id));
-
-    must_pass(git_odb_read(&obj, db, &id));
-    must_pass(cmp_objects((git_rawobj *)&obj->raw, &zero));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &zero));
-END_TEST
-
-BEGIN_TEST(readloose4, "read a one-byte long loose object")
-    git_odb *db;
-    git_oid id;
-    git_odb_object *obj;
-
-    must_pass(write_object_files(odb_dir, &one));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, one.id));
-
-    must_pass(git_odb_read(&obj, db, &id));
-    must_pass(cmp_objects(&obj->raw, &one));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &one));
-END_TEST
-
-BEGIN_TEST(readloose5, "read a two-bytes long loose object")
-    git_odb *db;
-    git_oid id;
-    git_odb_object *obj;
-
-    must_pass(write_object_files(odb_dir, &two));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, two.id));
-
-    must_pass(git_odb_read(&obj, db, &id));
-    must_pass(cmp_objects(&obj->raw, &two));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &two));
-END_TEST
-
-BEGIN_TEST(readloose6, "read a loose object which is several bytes long")
-    git_odb *db;
-    git_oid id;
-    git_odb_object *obj;
-
-    must_pass(write_object_files(odb_dir, &some));
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id, some.id));
-
-    must_pass(git_odb_read(&obj, db, &id));
-    must_pass(cmp_objects(&obj->raw, &some));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(odb_dir, &some));
-END_TEST
-
-BEGIN_TEST(readpack0, "read several packed objects")
-	unsigned int i;
-    git_odb *db;
-
-    must_pass(git_odb_open(&db, ODB_FOLDER));
-
-	for (i = 0; i < ARRAY_SIZE(packed_objects); ++i) {
-		git_oid id;
-		git_odb_object *obj;
-
-		must_pass(git_oid_fromstr(&id, packed_objects[i]));
-		must_be_true(git_odb_exists(db, &id) == 1);
-		must_pass(git_odb_read(&obj, db, &id));
-
-		git_odb_object_close(obj);
-	}
-
-    git_odb_close(db);
-END_TEST
-
-BEGIN_TEST(readheader0, "read only the header of several packed objects")
-	unsigned int i;
-    git_odb *db;
-
-    must_pass(git_odb_open(&db, ODB_FOLDER));
-
-	for (i = 0; i < ARRAY_SIZE(packed_objects); ++i) {
-		git_oid id;
-		git_odb_object *obj;
-		size_t len;
-		git_otype type;
-
-		must_pass(git_oid_fromstr(&id, packed_objects[i]));
-
-		must_pass(git_odb_read(&obj, db, &id));
-		must_pass(git_odb_read_header(&len, &type, db, &id));
-
-		must_be_true(obj->raw.len == len);
-		must_be_true(obj->raw.type == type);
-
-		git_odb_object_close(obj);
-	}
-
-    git_odb_close(db);
-END_TEST
-
-BEGIN_TEST(readheader1, "read only the header of several loose objects")
-	unsigned int i;
-    git_odb *db;
-
-    must_pass(git_odb_open(&db, ODB_FOLDER));
-
-	for (i = 0; i < ARRAY_SIZE(loose_objects); ++i) {
-		git_oid id;
-		git_odb_object *obj;
-		size_t len;
-		git_otype type;
-
-		must_pass(git_oid_fromstr(&id, loose_objects[i]));
-
-		must_be_true(git_odb_exists(db, &id) == 1);
-
-		must_pass(git_odb_read(&obj, db, &id));
-		must_pass(git_odb_read_header(&len, &type, db, &id));
-
-		must_be_true(obj->raw.len == len);
-		must_be_true(obj->raw.type == type);
-
-		git_odb_object_close(obj);
-	}
-
-    git_odb_close(db);
-END_TEST
-
-BEGIN_SUITE(objread)
-	ADD_TEST(existsloose0);
-
-	ADD_TEST(readloose0);
-	ADD_TEST(readloose1);
-	ADD_TEST(readloose2);
-	ADD_TEST(readloose3);
-	ADD_TEST(readloose4);
-	ADD_TEST(readloose5);
-	ADD_TEST(readloose6);
-
-/*
-	ADD_TEST(readloose_enc0);
-	ADD_TEST(readloose_enc1);
-	ADD_TEST(readloose_enc2);
-	ADD_TEST(readloose_enc3);
-	ADD_TEST(readloose_enc4);
-	ADD_TEST(readloose_enc5);
-	ADD_TEST(readloose_enc6);
-*/
-
-	ADD_TEST(readpack0);
-
-	ADD_TEST(readheader0);
-	ADD_TEST(readheader1);
-END_SUITE
diff --git a/tests/t02-oids.h b/tests/t02-oids.h
deleted file mode 100644
index 1a5ed5d..0000000
--- a/tests/t02-oids.h
+++ /dev/null
@@ -1,152 +0,0 @@
-
-static const char *packed_objects[] = {
-	"0266163a49e280c4f5ed1e08facd36a2bd716bcf",
-	"53fc32d17276939fc79ed05badaef2db09990016",
-	"6336846bd5c88d32f93ae57d846683e61ab5c530",
-	"6dcf9bf7541ee10456529833502442f385010c3d",
-	"bed08a0b30b72a9d4aed7f1af8c8ca124e8d64b9",
-	"e90810b8df3e80c413d903f631643c716887138d",
-	"fc3c3a2083e9f6f89e6bd53e9420e70d1e357c9b",
-	"fc58168adf502d0c0ef614c3111a7038fc8c09c8",
-	"fd0ec0333948dfe23265ac46be0205a436a8c3a5",
-	"fd8430bc864cfcd5f10e5590f8a447e01b942bfe",
-	"fd899f45951c15c1c5f7c34b1c864e91bd6556c6",
-	"fda23b974899e7e1f938619099280bfda13bdca9",
-	"fdbec189efb657c8325962b494875987881a356b",
-	"fe1ca6bd22b5d8353ce6c2f3aba80805c438a7a5",
-	"fe3a6a42c87ff1239370c741a265f3997add87c1",
-	"deb106bfd2d36ecf9f0079224c12022201a39ad1",
-	"dec93efc79e60f2680de3e666755d335967eec30",
-	"def425bf8568b9c1e20879bf5be6f9c52b7361c4",
-	"df48000ac4f48570054e3a71a81916357997b680",
-	"dfae6ed8f6dd8acc3b40a31811ea316239223559",
-	"dff79e27d3d2cdc09790ded80fe2ea8ff5d61034",
-	"e00e46abe4c542e17c8bc83d72cf5be8018d7b0e",
-	"e01b107b4f77f8f98645adac0206a504f2d29d7c",
-	"e032d863f512c47b479bd984f8b6c8061f66b7d4",
-	"e044baa468a1c74f9f9da36805445f6888358b49",
-	"e04529998989ba8ae3419538dd57969af819b241",
-	"e0637ddfbea67c8d7f557c709e095af8906e9176",
-	"e0743ad4031231e71700abdc6fdbe94f189d20e5",
-	"cf33ac7a3d8b2b8f6bb266518aadbf59de397608",
-	"cf5f7235b9c9689b133f6ea12015720b411329bd",
-	"cf6cccf1297284833a9a03138a1f5738fa1c6c94",
-	"cf7992bde17ce7a79cab5f0c1fcbe8a0108721ed",
-	"cfe3a027ab12506d4144ee8a35669ae8fc4b7ab1",
-	"cfe96f31dfad7bab49977aa1df7302f7fafcb025",
-	"cff54d138945ef4de384e9d2759291d0c13ea90a",
-	"d01f7573ac34c2f502bd1cf18cde73480c741151",
-	"d03f567593f346a1ca96a57f8191def098d126e3",
-	"d047b47aadf88501238f36f5c17dd0a50dc62087",
-	"d0a0d63086fae3b0682af7261df21f7d0f7f066d",
-	"d0a44bd6ed0be21b725a96c0891bbc79bc1a540c",
-	"d0d7e736e536a41bcb885005f8bf258c61cad682",
-	"d0e7959d4b95ffec6198df6f5a7ae259b23a5f50",
-	"bf2fe2acca17d13356ce802ba9dc8343f710dfb7",
-	"bf55f407d6d9418e51f42ea7a3a6aadf17388349",
-	"bf92206f8b633b88a66dca4a911777630b06fbac",
-	"bfaf8c42eb8842abe206179fee864cfba87e3ca9",
-	"bfe05675d4e8f6b59d50932add8790f1a06b10ee",
-	"bff8618112330763327cfa6ce6e914db84f51ddf",
-	"bff873e9853ed99fed52c25f7ad29f78b27dcec2",
-	"c01c3fae7251098d7af1b459bcd0786e81d4616d",
-	"c0220fca67f48b8a5d4163d53b1486224be3a198",
-	"c02d0b160b82ee72469c269f13de4c26a7ea09cb",
-	"c059510ad1b45ab58390e042d7dee1ac46703854",
-	"c07204a1897aeeaa3c248d29dbfa9b033baf9755",
-	"c073337a4dd7276931b4b3fdbc3f0040e9441793",
-	"0fd7e4bfba5b3a82be88d1057757ca8b2c5e6d26",
-	"100746511cc45c9f1ad6721c4ef5be49222fee4d",
-	"1088490171d9b984d68b8b9be9ca003f4eafff59",
-	"1093c8ff4cb78fcf5f79dbbeedcb6e824bd4e253",
-	"10aa3fa72afab7ee31e116ae06442fe0f7b79df2",
-	"10b759e734e8299aa0dca08be935d95d886127b6",
-	"111d5ccf0bb010c4e8d7af3eedfa12ef4c5e265b",
-	"11261fbff21758444d426356ff6327ee01e90752",
-	"112998d425717bb922ce74e8f6f0f831d8dc4510",
-	"2ef4e5d838b6507bd61d457cf6466662b791c5c0",
-	"2ef4faa0f82efa00eeac6cae9e8b2abccc8566ee",
-	"2f06098183b0d7be350acbe39cdbaccff2df0c4a",
-	"2f1c5d509ac5bffb3c62f710a1c2c542e126dfd1",
-	"2f205b20fc16423c42b3ba51b2ea78d7b9ff3578",
-	"2f9b6b6e3d9250ba09360734aa47973a993b59d1",
-	"30c62a2d5a8d644f1311d4f7fe3f6a788e4c8188",
-	"31438e245492d85fd6da4d1406eba0fbde8332a4",
-	"3184a3abdfea231992254929ff4e275898e5bbf6",
-	"3188ffdbb3a3d52e0f78f30c484533899224436e",
-	"32581d0093429770d044a60eb0e9cc0462bedb13",
-	"32679a9544d83e5403202c4d5efb61ad02492847",
-	"4e7e9f60b7e2049b7f5697daf133161a18ef688f",
-	"4e8cda27ddc8be7db875ceb0f360c37734724c6d",
-	"4ea481c61c59ab55169b7cbaae536ad50b49d6f0",
-	"4f0adcd0e61eabe06fe32be66b16559537124b7a",
-	"4f1355c91100d12f9e7202f91b245df0c110867c",
-	"4f6eadeb08b9d0d1e8b1b3eac8a34940adf29a2d",
-	"4f9339df943c53117a5fc8e86e2f38716ff3a668",
-	"4fc3874b118752e40de556b1c3e7b4a9f1737d00",
-	"4ff1dd0992dd6baafdb5e166be6f9f23b59bdf87",
-	"5018a35e0b7e2eec7ce5050baf9c7343f3f74164",
-	"50298f44a45eda3a29dae82dbe911b5aa176ac07",
-	"502acd164fb115768d723144da2e7bb5a24891bb",
-	"50330c02bd4fd95c9db1fcf2f97f4218e42b7226",
-	"5052bf355d9f8c52446561a39733a8767bf31e37",
-	"6f2cd729ae42988c1dd43588d3a6661ba48ad7a0",
-	"6f4e2c42d9138bfbf3e0f908f1308828cc6f2178",
-	"6f6a17db05a83620cef4572761831c20a70ba9b9",
-	"6faad60901e36538634f0d8b8ff3f21f83503c71",
-	"6fc72e46de3df0c3842dab302bbacf697a63abab",
-	"6fdccd49f442a7204399ca9b418f017322dbded8",
-	"6fe7568fc3861c334cb008fd85d57d9647249ef5",
-	"700f55d91d7b55665594676a4bada1f1457a0598",
-	"702bd70595a7b19afc48a1f784a6505be68469d4",
-	"7033f9ee0e52b08cb5679cd49b7b7999eaf9eaf8",
-	"70957110ce446c4e250f865760fb3da513cdcc92",
-	"8ec696a4734f16479d091bc70574d23dd9fe7443",
-	"8ed341c55ed4d6f4cdc8bf4f0ca18a08c93f6962",
-	"8edc2805f1f11b63e44bf81f4557f8b473612b69",
-	"8ef9060a954118a698fc10e20acdc430566a100f",
-	"8f0c4b543f4bb6eb1518ecfc3d4699e43108d393",
-	"8fac94df3035405c2e60b3799153ce7c428af6b9",
-	"904c0ac12b23548de524adae712241b423d765a3",
-	"90bbaa9a809c3a768d873a9cc7d52b4f3bf3d1b9",
-	"90d4d2f0fc362beabbbf76b4ffda0828229c198d",
-	"90f9ff6755330b685feff6c3d81782ee3592ab04",
-	"91822c50ebe4f9bf5bbb8308ecf9f6557062775c",
-	"91d973263a55708fa8255867b3202d81ef9c2868",
-	"af292c99c6148d772af3315a1c74e83330e7ead7",
-	"af3b99d5be330dbbce0b9250c3a5fb05911908cc",
-	"af55d0cdeb280af2db8697e5afa506e081012719",
-	"af795e498d411142ddb073e8ca2c5447c3295a4c",
-	"afadc73a392f8cc8e2cc77dd62a7433dd3bafa8c",
-	"affd84ed8ec7ce67612fe3c12a80f8164b101f6a",
-	"b0941f9c70ffe67f0387a827b338e64ecf3190f0",
-	"b0a3077f9ef6e093f8d9869bdb0c07095bd722cb",
-	"b0a8568a7614806378a54db5706ee3b06ae58693",
-	"b0fb7372f242233d1d35ce7d8e74d3990cbc5841",
-	"b10489944b9ead17427551759d180d10203e06ba",
-	"b196a807b323f2748ffc6b1d42cd0812d04c9a40",
-	"b1bb1d888f0c5e19278536d49fa77db035fac7ae"
-};
-
-static const char *loose_objects[] = {
-	"45b983be36b73c0788dc9cbcb76cbb80fc7bb057",
-	"a8233120f6ad708f843d861ce2b7228ec4e3dec6",
-	"fd093bff70906175335656e6ce6ae05783708765",
-	"c47800c7266a2be04c571c04d5a6614691ea99bd",
-	"a71586c1dfe8a71c6cbf6c129f404c5642ff31bd",
-	"8496071c1b46c854b31185ea97743be6a8774479",
-	"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
-	"814889a078c031f61ed08ab5fa863aea9314344d",
-	"5b5b025afb0b4c913b4c338a42934a3863bf3644",
-	"1385f264afb75a56a5bec74243be9b367ba4ca08",
-	"f60079018b664e4e79329a7ef9559c8d9e0378d1",
-	"be3563ae3f795b2b4353bcce3a527ad0a4f7f644",
-	"75057dd4114e74cca1d750d0aee1647c903cb60a",
-	"fa49b077972391ad58037050f2a75f74e3671e92",
-	"9fd738e8f7967c078dceed8190330fc8648ee56a",
-	"1810dff58d8a660512d4832e740f692884338ccd",
-	"181037049a54a1eb5fab404658a3a250b44335d7",
-	"a4a7dce85cf63874e984719f4fdd239f5145052f",
-	"4a202b346bb0fb0db7eff3cffeb3c70babbd2045"
-};
-
diff --git a/tests/t03-data.h b/tests/t03-data.h
deleted file mode 100644
index a4b73fe..0000000
--- a/tests/t03-data.h
+++ /dev/null
@@ -1,344 +0,0 @@
-
-typedef struct object_data {
-    char *id;     /* object id (sha1)                          */
-    char *dir;    /* object store (fan-out) directory name     */
-    char *file;   /* object store filename                     */
-} object_data;
-
-static object_data commit = {
-    "3d7f8a6af076c8c3f20071a8935cdbe8228594d1",
-    "test-objects/3d",
-    "test-objects/3d/7f8a6af076c8c3f20071a8935cdbe8228594d1",
-};
-
-static unsigned char commit_data[] = {
-    0x74, 0x72, 0x65, 0x65, 0x20, 0x64, 0x66, 0x66,
-    0x32, 0x64, 0x61, 0x39, 0x30, 0x62, 0x32, 0x35,
-    0x34, 0x65, 0x31, 0x62, 0x65, 0x62, 0x38, 0x38,
-    0x39, 0x64, 0x31, 0x66, 0x31, 0x66, 0x31, 0x32,
-    0x38, 0x38, 0x62, 0x65, 0x31, 0x38, 0x30, 0x33,
-    0x37, 0x38, 0x32, 0x64, 0x66, 0x0a, 0x61, 0x75,
-    0x74, 0x68, 0x6f, 0x72, 0x20, 0x41, 0x20, 0x55,
-    0x20, 0x54, 0x68, 0x6f, 0x72, 0x20, 0x3c, 0x61,
-    0x75, 0x74, 0x68, 0x6f, 0x72, 0x40, 0x65, 0x78,
-    0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
-    0x6d, 0x3e, 0x20, 0x31, 0x32, 0x32, 0x37, 0x38,
-    0x31, 0x34, 0x32, 0x39, 0x37, 0x20, 0x2b, 0x30,
-    0x30, 0x30, 0x30, 0x0a, 0x63, 0x6f, 0x6d, 0x6d,
-    0x69, 0x74, 0x74, 0x65, 0x72, 0x20, 0x43, 0x20,
-    0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74, 0x65, 0x72,
-    0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
-    0x74, 0x65, 0x72, 0x40, 0x65, 0x78, 0x61, 0x6d,
-    0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x3e,
-    0x20, 0x31, 0x32, 0x32, 0x37, 0x38, 0x31, 0x34,
-    0x32, 0x39, 0x37, 0x20, 0x2b, 0x30, 0x30, 0x30,
-    0x30, 0x0a, 0x0a, 0x41, 0x20, 0x6f, 0x6e, 0x65,
-    0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x6d, 0x69, 0x74, 0x20, 0x73, 0x75, 0x6d,
-    0x6d, 0x61, 0x72, 0x79, 0x0a, 0x0a, 0x54, 0x68,
-    0x65, 0x20, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x6f,
-    0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x6d, 0x69, 0x74, 0x20, 0x6d, 0x65, 0x73,
-    0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x63, 0x6f,
-    0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67,
-    0x20, 0x66, 0x75, 0x72, 0x74, 0x68, 0x65, 0x72,
-    0x20, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61,
-    0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x6f, 0x66, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x72, 0x70,
-    0x6f, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67,
-    0x65, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f,
-    0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d,
-    0x6d, 0x69, 0x74, 0x2e, 0x0a, 0x0a, 0x53, 0x69,
-    0x67, 0x6e, 0x65, 0x64, 0x2d, 0x6f, 0x66, 0x2d,
-    0x62, 0x79, 0x3a, 0x20, 0x41, 0x20, 0x55, 0x20,
-    0x54, 0x68, 0x6f, 0x72, 0x20, 0x3c, 0x61, 0x75,
-    0x74, 0x68, 0x6f, 0x72, 0x40, 0x65, 0x78, 0x61,
-    0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
-    0x3e, 0x0a,
-};
-
-static git_rawobj commit_obj = {
-	commit_data,
-	sizeof(commit_data),
-	GIT_OBJ_COMMIT
-};
-
-static object_data tree = {
-    "dff2da90b254e1beb889d1f1f1288be1803782df",
-    "test-objects/df",
-    "test-objects/df/f2da90b254e1beb889d1f1f1288be1803782df",
-};
-
-static unsigned char tree_data[] = {
-    0x31, 0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x6f,
-    0x6e, 0x65, 0x00, 0x8b, 0x13, 0x78, 0x91, 0x79,
-    0x1f, 0xe9, 0x69, 0x27, 0xad, 0x78, 0xe6, 0x4b,
-    0x0a, 0xad, 0x7b, 0xde, 0xd0, 0x8b, 0xdc, 0x31,
-    0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x73, 0x6f,
-    0x6d, 0x65, 0x00, 0xfd, 0x84, 0x30, 0xbc, 0x86,
-    0x4c, 0xfc, 0xd5, 0xf1, 0x0e, 0x55, 0x90, 0xf8,
-    0xa4, 0x47, 0xe0, 0x1b, 0x94, 0x2b, 0xfe, 0x31,
-    0x30, 0x30, 0x36, 0x34, 0x34, 0x20, 0x74, 0x77,
-    0x6f, 0x00, 0x78, 0x98, 0x19, 0x22, 0x61, 0x3b,
-    0x2a, 0xfb, 0x60, 0x25, 0x04, 0x2f, 0xf6, 0xbd,
-    0x87, 0x8a, 0xc1, 0x99, 0x4e, 0x85, 0x31, 0x30,
-    0x30, 0x36, 0x34, 0x34, 0x20, 0x7a, 0x65, 0x72,
-    0x6f, 0x00, 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1,
-    0xd6, 0x43, 0x4b, 0x8b, 0x29, 0xae, 0x77, 0x5a,
-    0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91,
-};
-
-static git_rawobj tree_obj = {
-	tree_data,
-	sizeof(tree_data),
-	GIT_OBJ_TREE
-};
-
-static object_data tag = {
-    "09d373e1dfdc16b129ceec6dd649739911541e05",
-    "test-objects/09",
-    "test-objects/09/d373e1dfdc16b129ceec6dd649739911541e05",
-};
-
-static unsigned char tag_data[] = {
-    0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x33,
-    0x64, 0x37, 0x66, 0x38, 0x61, 0x36, 0x61, 0x66,
-    0x30, 0x37, 0x36, 0x63, 0x38, 0x63, 0x33, 0x66,
-    0x32, 0x30, 0x30, 0x37, 0x31, 0x61, 0x38, 0x39,
-    0x33, 0x35, 0x63, 0x64, 0x62, 0x65, 0x38, 0x32,
-    0x32, 0x38, 0x35, 0x39, 0x34, 0x64, 0x31, 0x0a,
-    0x74, 0x79, 0x70, 0x65, 0x20, 0x63, 0x6f, 0x6d,
-    0x6d, 0x69, 0x74, 0x0a, 0x74, 0x61, 0x67, 0x20,
-    0x76, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x0a, 0x74,
-    0x61, 0x67, 0x67, 0x65, 0x72, 0x20, 0x43, 0x20,
-    0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74, 0x65, 0x72,
-    0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
-    0x74, 0x65, 0x72, 0x40, 0x65, 0x78, 0x61, 0x6d,
-    0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x3e,
-    0x20, 0x31, 0x32, 0x32, 0x37, 0x38, 0x31, 0x34,
-    0x32, 0x39, 0x37, 0x20, 0x2b, 0x30, 0x30, 0x30,
-    0x30, 0x0a, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20,
-    0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,
-    0x61, 0x67, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63,
-    0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65,
-    0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x76, 0x30,
-    0x2e, 0x30, 0x2e, 0x31, 0x0a,
-};
-
-static git_rawobj tag_obj = {
-	tag_data,
-	sizeof(tag_data),
-	GIT_OBJ_TAG
-};
-
-static object_data zero = {
-    "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
-    "test-objects/e6",
-    "test-objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391",
-};
-
-static unsigned char zero_data[] = {
-    0x00  /* dummy data */
-};
-
-static git_rawobj zero_obj = {
-	zero_data,
-	0,
-	GIT_OBJ_BLOB
-};
-
-static object_data one = {
-    "8b137891791fe96927ad78e64b0aad7bded08bdc",
-    "test-objects/8b",
-    "test-objects/8b/137891791fe96927ad78e64b0aad7bded08bdc",
-};
-
-static unsigned char one_data[] = {
-    0x0a,
-};
-
-static git_rawobj one_obj = {
-	one_data,
-	sizeof(one_data),
-	GIT_OBJ_BLOB
-};
-
-static object_data two = {
-    "78981922613b2afb6025042ff6bd878ac1994e85",
-    "test-objects/78",
-    "test-objects/78/981922613b2afb6025042ff6bd878ac1994e85",
-};
-
-static unsigned char two_data[] = {
-    0x61, 0x0a,
-};
-
-static git_rawobj two_obj = {
-	two_data,
-	sizeof(two_data),
-	GIT_OBJ_BLOB
-};
-
-static object_data some = {
-    "fd8430bc864cfcd5f10e5590f8a447e01b942bfe",
-    "test-objects/fd",
-    "test-objects/fd/8430bc864cfcd5f10e5590f8a447e01b942bfe",
-};
-
-static unsigned char some_data[] = {
-    0x2f, 0x2a, 0x0a, 0x20, 0x2a, 0x20, 0x54, 0x68,
-    0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20,
-    0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20,
-    0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x3b, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61,
-    0x6e, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74,
-    0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x69,
-    0x74, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72,
-    0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x0a,
-    0x20, 0x2a, 0x20, 0x69, 0x74, 0x20, 0x75, 0x6e,
-    0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c,
-    0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
-    0x20, 0x32, 0x2c, 0x0a, 0x20, 0x2a, 0x20, 0x61,
-    0x73, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
-    0x68, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20,
-    0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x2a, 0x0a,
-    0x20, 0x2a, 0x20, 0x49, 0x6e, 0x20, 0x61, 0x64,
-    0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74,
-    0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x65,
-    0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
-    0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,
-    0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x65, 0x6e,
-    0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62,
-    0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65,
-    0x6e, 0x73, 0x65, 0x2c, 0x0a, 0x20, 0x2a, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x61, 0x75, 0x74, 0x68,
-    0x6f, 0x72, 0x73, 0x20, 0x67, 0x69, 0x76, 0x65,
-    0x20, 0x79, 0x6f, 0x75, 0x20, 0x75, 0x6e, 0x6c,
-    0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x70,
-    0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
-    0x6e, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x6e,
-    0x6b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f,
-    0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x0a, 0x20,
-    0x2a, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
-    0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69,
-    0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x69,
-    0x6e, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x62,
-    0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
-    0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6f, 0x74,
-    0x68, 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67,
-    0x72, 0x61, 0x6d, 0x73, 0x2c, 0x0a, 0x20, 0x2a,
-    0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20,
-    0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75,
-    0x74, 0x65, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65,
-    0x20, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61,
-    0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69,
-    0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x6e,
-    0x79, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69,
-    0x63, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x2a,
-    0x20, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x20,
-    0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65,
-    0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20,
-    0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c,
-    0x65, 0x2e, 0x20, 0x20, 0x28, 0x54, 0x68, 0x65,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a,
-    0x20, 0x2a, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72,
-    0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,
-    0x64, 0x6f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79,
-    0x20, 0x69, 0x6e, 0x20, 0x6f, 0x74, 0x68, 0x65,
-    0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63,
-    0x74, 0x73, 0x3b, 0x20, 0x66, 0x6f, 0x72, 0x20,
-    0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c,
-    0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x63, 0x6f,
-    0x76, 0x65, 0x72, 0x0a, 0x20, 0x2a, 0x20, 0x6d,
-    0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c,
-    0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x73,
-    0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f,
-    0x6e, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6e,
-    0x6f, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x6b, 0x65,
-    0x64, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x0a, 0x20,
-    0x2a, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x62,
-    0x69, 0x6e, 0x65, 0x64, 0x20, 0x65, 0x78, 0x65,
-    0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e,
-    0x29, 0x0a, 0x20, 0x2a, 0x0a, 0x20, 0x2a, 0x20,
-    0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c,
-    0x65, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73,
-    0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64,
-    0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x68, 0x6f, 0x70, 0x65, 0x20, 0x74, 0x68, 0x61,
-    0x74, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c,
-    0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65,
-    0x66, 0x75, 0x6c, 0x2c, 0x20, 0x62, 0x75, 0x74,
-    0x0a, 0x20, 0x2a, 0x20, 0x57, 0x49, 0x54, 0x48,
-    0x4f, 0x55, 0x54, 0x20, 0x41, 0x4e, 0x59, 0x20,
-    0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59,
-    0x3b, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75,
-    0x74, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69,
-    0x65, 0x64, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61,
-    0x6e, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x0a, 0x20,
-    0x2a, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41,
-    0x4e, 0x54, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54,
-    0x59, 0x20, 0x6f, 0x72, 0x20, 0x46, 0x49, 0x54,
-    0x4e, 0x45, 0x53, 0x53, 0x20, 0x46, 0x4f, 0x52,
-    0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49,
-    0x43, 0x55, 0x4c, 0x41, 0x52, 0x20, 0x50, 0x55,
-    0x52, 0x50, 0x4f, 0x53, 0x45, 0x2e, 0x20, 0x20,
-    0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,
-    0x47, 0x4e, 0x55, 0x0a, 0x20, 0x2a, 0x20, 0x47,
-    0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50,
-    0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69,
-    0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x66, 0x6f,
-    0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x64,
-    0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x0a,
-    0x20, 0x2a, 0x0a, 0x20, 0x2a, 0x20, 0x59, 0x6f,
-    0x75, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,
-    0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, 0x65,
-    0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x61,
-    0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66,
-    0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55,
-    0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
-    0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
-    0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a,
-    0x20, 0x2a, 0x20, 0x61, 0x6c, 0x6f, 0x6e, 0x67,
-    0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68,
-    0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72,
-    0x61, 0x6d, 0x3b, 0x20, 0x73, 0x65, 0x65, 0x20,
-    0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65,
-    0x20, 0x43, 0x4f, 0x50, 0x59, 0x49, 0x4e, 0x47,
-    0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f,
-    0x74, 0x2c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65,
-    0x20, 0x74, 0x6f, 0x0a, 0x20, 0x2a, 0x20, 0x74,
-    0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20,
-    0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
-    0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74,
-    0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x35, 0x31, 0x20,
-    0x46, 0x72, 0x61, 0x6e, 0x6b, 0x6c, 0x69, 0x6e,
-    0x20, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74, 0x2c,
-    0x20, 0x46, 0x69, 0x66, 0x74, 0x68, 0x20, 0x46,
-    0x6c, 0x6f, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x2a,
-    0x20, 0x42, 0x6f, 0x73, 0x74, 0x6f, 0x6e, 0x2c,
-    0x20, 0x4d, 0x41, 0x20, 0x30, 0x32, 0x31, 0x31,
-    0x30, 0x2d, 0x31, 0x33, 0x30, 0x31, 0x2c, 0x20,
-    0x55, 0x53, 0x41, 0x2e, 0x0a, 0x20, 0x2a, 0x2f,
-    0x0a,
-};
-
-static git_rawobj some_obj = {
-	some_data,
-	sizeof(some_data),
-	GIT_OBJ_BLOB
-};
diff --git a/tests/t03-objwrite.c b/tests/t03-objwrite.c
deleted file mode 100644
index 31f611a..0000000
--- a/tests/t03-objwrite.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "fileops.h"
-#include "odb.h"
-
-static char *odb_dir = "test-objects";
-#include "t03-data.h"
-
-static int make_odb_dir(void)
-{
-	if (p_mkdir(odb_dir, 0755) < 0) {
-		int err = errno;
-		fprintf(stderr, "can't make directory \"%s\"", odb_dir);
-		if (err == EEXIST)
-			fprintf(stderr, " (already exists)");
-		fprintf(stderr, "\n");
-		return -1;
-	}
-	return 0;
-}
-
-static int check_object_files(object_data *d)
-{
-	if (git_futils_exists(d->dir) < 0)
-		return -1;
-	if (git_futils_exists(d->file) < 0)
-		return -1;
-	return 0;
-}
-
-static int cmp_objects(git_rawobj *o1, git_rawobj *o2)
-{
-	if (o1->type != o2->type)
-		return -1;
-	if (o1->len != o2->len)
-		return -1;
-	if ((o1->len > 0) && (memcmp(o1->data, o2->data, o1->len) != 0))
-		return -1;
-	return 0;
-}
-
-static int remove_object_files(object_data *d)
-{
-	if (p_unlink(d->file) < 0) {
-		fprintf(stderr, "can't delete object file \"%s\"\n", d->file);
-		return -1;
-	}
-	if ((p_rmdir(d->dir) < 0) && (errno != ENOTEMPTY)) {
-		fprintf(stderr, "can't remove directory \"%s\"\n", d->dir);
-		return -1;
-	}
-
-	if (p_rmdir(odb_dir) < 0) {
-		fprintf(stderr, "can't remove directory \"%s\"\n", odb_dir);
-		return -1;
-	}
-
-	return 0;
-}
-
-static int streaming_write(git_oid *oid, git_odb *odb, git_rawobj *raw)
-{
-	git_odb_stream *stream;
-	int error;
-
-	if ((error = git_odb_open_wstream(&stream, odb, raw->len, raw->type)) < GIT_SUCCESS)
-		return error;
-
-	stream->write(stream, raw->data, raw->len);
-
-	error = stream->finalize_write(oid, stream);
-	stream->free(stream);
-
-	return error;
-}
-
-BEGIN_TEST(write0, "write loose commit object")
-    git_odb *db;
-    git_oid id1, id2;
-    git_odb_object *obj;
-
-    must_pass(make_odb_dir());
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id1, commit.id));
-
-    must_pass(streaming_write(&id2, db, &commit_obj));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-    must_pass(check_object_files(&commit));
-
-    must_pass(git_odb_read(&obj, db, &id1));
-    must_pass(cmp_objects(&obj->raw, &commit_obj));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(&commit));
-END_TEST
-
-BEGIN_TEST(write1, "write loose tree object")
-    git_odb *db;
-    git_oid id1, id2;
-    git_odb_object *obj;
-
-    must_pass(make_odb_dir());
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id1, tree.id));
-
-    must_pass(streaming_write(&id2, db, &tree_obj));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-    must_pass(check_object_files(&tree));
-
-    must_pass(git_odb_read(&obj, db, &id1));
-    must_pass(cmp_objects(&obj->raw, &tree_obj));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(&tree));
-END_TEST
-
-BEGIN_TEST(write2, "write loose tag object")
-    git_odb *db;
-    git_oid id1, id2;
-    git_odb_object *obj;
-
-    must_pass(make_odb_dir());
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id1, tag.id));
-
-    must_pass(streaming_write(&id2, db, &tag_obj));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-    must_pass(check_object_files(&tag));
-
-    must_pass(git_odb_read(&obj, db, &id1));
-    must_pass(cmp_objects(&obj->raw, &tag_obj));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(&tag));
-END_TEST
-
-BEGIN_TEST(write3, "write zero-length object")
-    git_odb *db;
-    git_oid id1, id2;
-    git_odb_object *obj;
-
-    must_pass(make_odb_dir());
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id1, zero.id));
-
-    must_pass(streaming_write(&id2, db, &zero_obj));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-    must_pass(check_object_files(&zero));
-
-    must_pass(git_odb_read(&obj, db, &id1));
-    must_pass(cmp_objects(&obj->raw, &zero_obj));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(&zero));
-END_TEST
-
-BEGIN_TEST(write4, "write one-byte long object")
-    git_odb *db;
-    git_oid id1, id2;
-    git_odb_object *obj;
-
-    must_pass(make_odb_dir());
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id1, one.id));
-
-    must_pass(streaming_write(&id2, db, &one_obj));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-    must_pass(check_object_files(&one));
-
-    must_pass(git_odb_read(&obj, db, &id1));
-    must_pass(cmp_objects(&obj->raw, &one_obj));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(&one));
-END_TEST
-
-BEGIN_TEST(write5, "write two-byte long object")
-    git_odb *db;
-    git_oid id1, id2;
-    git_odb_object *obj;
-
-    must_pass(make_odb_dir());
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id1, two.id));
-
-    must_pass(streaming_write(&id2, db, &two_obj));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-    must_pass(check_object_files(&two));
-
-    must_pass(git_odb_read(&obj, db, &id1));
-    must_pass(cmp_objects(&obj->raw, &two_obj));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(&two));
-END_TEST
-
-BEGIN_TEST(write6, "write an object which is several bytes long")
-    git_odb *db;
-    git_oid id1, id2;
-    git_odb_object *obj;
-
-    must_pass(make_odb_dir());
-    must_pass(git_odb_open(&db, odb_dir));
-    must_pass(git_oid_fromstr(&id1, some.id));
-
-    must_pass(streaming_write(&id2, db, &some_obj));
-    must_be_true(git_oid_cmp(&id1, &id2) == 0);
-    must_pass(check_object_files(&some));
-
-    must_pass(git_odb_read(&obj, db, &id1));
-    must_pass(cmp_objects(&obj->raw, &some_obj));
-
-    git_odb_object_close(obj);
-    git_odb_close(db);
-    must_pass(remove_object_files(&some));
-END_TEST
-
-BEGIN_SUITE(objwrite)
-	ADD_TEST(write0);
-	ADD_TEST(write1);
-	ADD_TEST(write2);
-	ADD_TEST(write3);
-	ADD_TEST(write4);
-	ADD_TEST(write5);
-	ADD_TEST(write6);
-END_SUITE
diff --git a/tests/t04-commit.c b/tests/t04-commit.c
deleted file mode 100644
index a8617ed..0000000
--- a/tests/t04-commit.c
+++ /dev/null
@@ -1,775 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include "commit.h"
-#include "signature.h"
-
-static char *test_commits_broken[] = {
-
-/* empty commit */
-"",
-
-/* random garbage */
-"asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n",
-
-/* broken endlines 1 */
-"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\
-parent 05452d6349abcd67aa396dfb28660d765d8b2a36\r\n\
-author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\
-committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\
-\r\n\
-a test commit with broken endlines\r\n",
-
-/* broken endlines 2 */
-"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\
-parent 05452d6349abcd67aa396dfb28660d765d8b2a36\
-author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\
-committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\
-\
-another test commit with broken endlines",
-
-/* starting endlines */
-"\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
-parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
-author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-\n\
-a test commit with a starting endline\n",
-
-/* corrupted commit 1 */
-"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
-parent 05452d6349abcd67aa396df",
-
-/* corrupted commit 2 */
-"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
-parent ",
-
-/* corrupted commit 3 */
-"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
-parent ",
-
-/* corrupted commit 4 */
-"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
-par",
-
-};
-
-
-static char *test_commits_working[] = {
-/* simple commit with no message */
-"tree 1810dff58d8a660512d4832e740f692884338ccd\n\
-author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-\n",
-
-/* simple commit, no parent */
-"tree 1810dff58d8a660512d4832e740f692884338ccd\n\
-author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-\n\
-a simple commit which works\n",
-
-/* simple commit, no parent, no newline in message */
-"tree 1810dff58d8a660512d4832e740f692884338ccd\n\
-author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-\n\
-a simple commit which works",
-
-/* simple commit, 1 parent */
-"tree 1810dff58d8a660512d4832e740f692884338ccd\n\
-parent e90810b8df3e80c413d903f631643c716887138d\n\
-author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
-\n\
-a simple commit which works\n",
-};
-
-BEGIN_TEST(parse0, "parse the OID line in a commit")
-
-	git_oid oid;
-
-#define TEST_OID_PASS(string, header) { \
-	const char *ptr = string;\
-	const char *ptr_original = ptr;\
-	size_t len = strlen(ptr);\
-	must_pass(git_oid__parse(&oid, &ptr, ptr + len, header));\
-	must_be_true(ptr == ptr_original + len);\
-}
-
-#define TEST_OID_FAIL(string, header) { \
-	const char *ptr = string;\
-	size_t len = strlen(ptr);\
-	must_fail(git_oid__parse(&oid, &ptr, ptr + len, header));\
-}
-
-	TEST_OID_PASS("parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n", "parent ");
-	TEST_OID_PASS("tree 05452d6349abcd67aa396dfb28660d765d8b2a36\n", "tree ");
-	TEST_OID_PASS("random_heading 05452d6349abcd67aa396dfb28660d765d8b2a36\n", "random_heading ");
-	TEST_OID_PASS("stuck_heading05452d6349abcd67aa396dfb28660d765d8b2a36\n", "stuck_heading");
-	TEST_OID_PASS("tree 5F4BEFFC0759261D015AA63A3A85613FF2F235DE\n", "tree ");
-	TEST_OID_PASS("tree 1A669B8AB81B5EB7D9DB69562D34952A38A9B504\n", "tree ");
-	TEST_OID_PASS("tree 5B20DCC6110FCC75D31C6CEDEBD7F43ECA65B503\n", "tree ");
-	TEST_OID_PASS("tree 173E7BF00EA5C33447E99E6C1255954A13026BE4\n", "tree ");
-
-	TEST_OID_FAIL("parent 05452d6349abcd67aa396dfb28660d765d8b2a36", "parent ");
-	TEST_OID_FAIL("05452d6349abcd67aa396dfb28660d765d8b2a36\n", "tree ");
-	TEST_OID_FAIL("parent05452d6349abcd67aa396dfb28660d765d8b2a6a\n", "parent ");
-	TEST_OID_FAIL("parent 05452d6349abcd67aa396dfb280d765d8b2a6\n", "parent ");
-	TEST_OID_FAIL("tree  05452d6349abcd67aa396dfb28660d765d8b2a36\n", "tree ");
-	TEST_OID_FAIL("parent 0545xd6349abcd67aa396dfb28660d765d8b2a36\n", "parent ");
-	TEST_OID_FAIL("parent 0545xd6349abcd67aa396dfb28660d765d8b2a36FF\n", "parent ");
-	TEST_OID_FAIL("", "tree ");
-	TEST_OID_FAIL("", "");
-
-#undef TEST_OID_PASS
-#undef TEST_OID_FAIL
-
-END_TEST
-
-BEGIN_TEST(parse1, "parse the signature line in a commit")
-
-#define TEST_SIGNATURE_PASS(_string, _header, _name, _email, _time, _offset) { \
-	const char *ptr = _string; \
-	size_t len = strlen(_string);\
-	git_signature person = {NULL, NULL, {0, 0}}; \
-	must_pass(git_signature__parse(&person, &ptr, ptr + len, _header, '\n'));\
-	must_be_true(strcmp(_name, person.name) == 0);\
-	must_be_true(strcmp(_email, person.email) == 0);\
-	must_be_true(_time == person.when.time);\
-	must_be_true(_offset == person.when.offset);\
-	free(person.name); free(person.email);\
-}
-
-#define TEST_SIGNATURE_FAIL(_string, _header) { \
-	const char *ptr = _string; \
-	size_t len = strlen(_string);\
-	git_signature person = {NULL, NULL, {0, 0}}; \
-	must_fail(git_signature__parse(&person, &ptr, ptr + len, _header, '\n'));\
-	free(person.name); free(person.email);\
-}
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <tanoku@gmail.com> 12345 \n",
-		"author ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		12345,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <> 12345 \n",
-		"author ",
-		"Vicent Marti",
-		"",
-		12345,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <tanoku@gmail.com> 231301 +1020\n",
-		"author ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		231301,
-		620);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti with an outrageously long name \
-		which will probably overflow the buffer <tanoku@gmail.com> 12345 \n",
-		"author ",
-		"Vicent Marti with an outrageously long name \
-		which will probably overflow the buffer",
-		"tanoku@gmail.com",
-		12345,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <tanokuwithaveryveryverylongemail\
-		whichwillprobablyvoverflowtheemailbuffer@gmail.com> 12345 \n",
-		"author ",
-		"Vicent Marti",
-		"tanokuwithaveryveryverylongemail\
-		whichwillprobablyvoverflowtheemailbuffer@gmail.com",
-		12345,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"committer Vicent Marti <tanoku@gmail.com> 123456 +0000 \n",
-		"committer ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		123456,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"committer Vicent Marti <tanoku@gmail.com> 123456 +0100 \n",
-		"committer ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		123456,
-		60);
-
-	TEST_SIGNATURE_PASS(
-		"committer Vicent Marti <tanoku@gmail.com> 123456 -0100 \n",
-		"committer ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		123456,
-		-60);
-
-	/* Parse a signature without an author field */
-	TEST_SIGNATURE_PASS(
-		"committer <tanoku@gmail.com> 123456 -0100 \n",
-		"committer ",
-		"",
-		"tanoku@gmail.com",
-		123456,
-		-60);
-
-	/* Parse a signature without an author field */
-	TEST_SIGNATURE_PASS(
-		"committer  <tanoku@gmail.com> 123456 -0100 \n",
-		"committer ",
-		"",
-		"tanoku@gmail.com",
-		123456,
-		-60);
-
-	/* Parse a signature with an empty author field */
-	TEST_SIGNATURE_PASS(
-		"committer   <tanoku@gmail.com> 123456 -0100 \n",
-		"committer ",
-		"",
-		"tanoku@gmail.com",
-		123456,
-		-60);
-
-	/* Parse a signature with an empty email field */
-	TEST_SIGNATURE_PASS(
-		"committer Vicent Marti <> 123456 -0100 \n",
-		"committer ",
-		"Vicent Marti",
-		"",
-		123456,
-		-60);
-
-	/* Parse a signature with an empty email field */
-	TEST_SIGNATURE_PASS(
-		"committer Vicent Marti < > 123456 -0100 \n",
-		"committer ",
-		"Vicent Marti",
-		"",
-		123456,
-		-60);
-
-	/* Parse a signature with empty name and email */
-	TEST_SIGNATURE_PASS(
-		"committer <> 123456 -0100 \n",
-		"committer ",
-		"",
-		"",
-		123456,
-		-60);
-
-	/* Parse a signature with empty name and email */
-	TEST_SIGNATURE_PASS(
-		"committer  <> 123456 -0100 \n",
-		"committer ",
-		"",
-		"",
-		123456,
-		-60);
-
-	/* Parse a signature with empty name and email */
-	TEST_SIGNATURE_PASS(
-		"committer  < > 123456 -0100 \n",
-		"committer ",
-		"",
-		"",
-		123456,
-		-60);
-
-	/* Parse an obviously invalid signature */
-	TEST_SIGNATURE_PASS(
-		"committer foo<@bar> 123456 -0100 \n",
-		"committer ",
-		"foo",
-		"@bar",
-		123456,
-		-60);
-
-	/* Parse an obviously invalid signature */
-	TEST_SIGNATURE_PASS(
-		"committer    foo<@bar>123456 -0100 \n",
-		"committer ",
-		"foo",
-		"@bar",
-		123456,
-		-60);
-
-	/* Parse an obviously invalid signature */
-	TEST_SIGNATURE_PASS(
-		"committer <>\n",
-		"committer ",
-		"",
-		"",
-		0,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"committer Vicent Marti <tanoku@gmail.com> 123456 -1500 \n",
-		"committer ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		0,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"committer Vicent Marti <tanoku@gmail.com> 123456 +0163 \n",
-		"committer ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		0,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <tanoku@gmail.com> notime \n",
-		"author ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		0,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <tanoku@gmail.com> 123456 notimezone \n",
-		"author ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		0,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <tanoku@gmail.com> notime +0100\n",
-		"author ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		0,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author Vicent Marti <tanoku@gmail.com>\n",
-		"author ",
-		"Vicent Marti",
-		"tanoku@gmail.com",
-		0,
-		0);
-
-	TEST_SIGNATURE_PASS(
-		"author A U Thor <author@example.com>,  C O. Miter <comiter@example.com> 1234567890 -0700\n",
-		"author ",
-		"A U Thor",
-		"author@example.com",
-		1234567890,
-		-420);
-
-	TEST_SIGNATURE_PASS(
-		"author A U Thor <author@example.com> and others 1234567890 -0700\n",
-		"author ",
-		"A U Thor",
-		"author@example.com",
-		1234567890,
-		-420);
-
-	TEST_SIGNATURE_PASS(
-		"author A U Thor <author@example.com> and others 1234567890\n",
-		"author ",
-		"A U Thor",
-		"author@example.com",
-		1234567890,
-		0);
-
-	TEST_SIGNATURE_FAIL(
-		"committer Vicent Marti tanoku@gmail.com> 123456 -0100 \n",
-		"committer ");
-
-	TEST_SIGNATURE_FAIL(
-		"author Vicent Marti <tanoku@gmail.com> 12345 \n",
-		"author  ");
-
-	TEST_SIGNATURE_FAIL(
-		"author Vicent Marti <tanoku@gmail.com> 12345 \n",
-		"committer ");
-
-	TEST_SIGNATURE_FAIL(
-		"author Vicent Marti 12345 \n",
-		"author ");
-
-	TEST_SIGNATURE_FAIL(
-		"author Vicent Marti <broken@email 12345 \n",
-		"author ");
-
-	TEST_SIGNATURE_FAIL(
-		"committer Vicent Marti ><\n",
-		"committer ");
-
-	TEST_SIGNATURE_FAIL(
-		"author ",
-		"author ");
-
-#undef TEST_SIGNATURE_PASS
-#undef TEST_SIGNATURE_FAIL
-
-END_TEST
-
-static int try_build_signature(const char *name, const char *email, git_time_t time, int offset)
-{
-	git_signature *sign;
-	int error = GIT_SUCCESS;
-
-	if ((error =  git_signature_new(&sign, name, email, time, offset)) < GIT_SUCCESS)
-		return error;
-
-	git_signature_free((git_signature *)sign);
-
-	return error;
-}
-
-BEGIN_TEST(signature0, "creating a signature trims leading and trailing spaces")
-	git_signature *sign;
-	must_pass(git_signature_new(&sign, "  nulltoken ", "   emeric.fermas@gmail.com     ", 1234567890, 60));
-	must_be_true(strcmp(sign->name, "nulltoken") == 0);
-	must_be_true(strcmp(sign->email, "emeric.fermas@gmail.com") == 0);
-	git_signature_free((git_signature *)sign);
-END_TEST
-
-BEGIN_TEST(signature1, "can not create a signature with empty name or email")
-	must_pass(try_build_signature("nulltoken", "emeric.fermas@gmail.com", 1234567890, 60));
-
-	must_fail(try_build_signature("", "emeric.fermas@gmail.com", 1234567890, 60));
-	must_fail(try_build_signature("   ", "emeric.fermas@gmail.com", 1234567890, 60));
-	must_fail(try_build_signature("nulltoken", "", 1234567890, 60));
-	must_fail(try_build_signature("nulltoken", "  ", 1234567890, 60));
-END_TEST
-
-BEGIN_TEST(signature2, "creating a one character signature")
-	git_signature *sign;
-	must_pass(git_signature_new(&sign, "x", "foo@bar.baz", 1234567890, 60));
-	must_be_true(strcmp(sign->name, "x") == 0);
-	must_be_true(strcmp(sign->email, "foo@bar.baz") == 0);
-	git_signature_free((git_signature *)sign);
-END_TEST
-
-BEGIN_TEST(signature3, "creating a two character signature")
-	git_signature *sign;
-	must_pass(git_signature_new(&sign, "xx", "x@y.z", 1234567890, 60));
-	must_be_true(strcmp(sign->name, "xx") == 0);
-	must_be_true(strcmp(sign->email, "x@y.z") == 0);
-	git_signature_free((git_signature *)sign);
-END_TEST
-
-BEGIN_TEST(signature4, "creating a zero character signature")
-	git_signature *sign;
-	must_fail(git_signature_new(&sign, "", "x@y.z", 1234567890, 60));
-	must_be_true(sign == NULL);
-END_TEST
-
-
-/* External declaration for testing the buffer parsing method */
-int commit_parse_buffer(git_commit *commit, void *data, size_t len);
-
-BEGIN_TEST(parse2, "parse a whole commit buffer")
-	const int broken_commit_count = sizeof(test_commits_broken) / sizeof(*test_commits_broken);
-	const int working_commit_count = sizeof(test_commits_working) / sizeof(*test_commits_working);
-
-	int i;
-	git_repository *repo;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	for (i = 0; i < broken_commit_count; ++i) {
-		git_commit *commit;
-		commit = git__malloc(sizeof(git_commit));
-		memset(commit, 0x0, sizeof(git_commit));
-		commit->object.repo = repo;
-
-		must_fail(commit_parse_buffer(
-					commit,
-					test_commits_broken[i],
-					strlen(test_commits_broken[i]))
-				);
-
-		git_commit__free(commit);
-	}
-
-	for (i = 0; i < working_commit_count; ++i) {
-		git_commit *commit;
-
-		commit = git__malloc(sizeof(git_commit));
-		memset(commit, 0x0, sizeof(git_commit));
-		commit->object.repo = repo;
-
-		must_pass(commit_parse_buffer(
-					commit,
-					test_commits_working[i],
-					strlen(test_commits_working[i]))
-				);
-
-		git_commit__free(commit);
-
-		commit = git__malloc(sizeof(git_commit));
-		memset(commit, 0x0, sizeof(git_commit));
-		commit->object.repo = repo;
-
-		must_pass(commit_parse_buffer(
-					commit,
-					test_commits_working[i],
-					strlen(test_commits_working[i]))
-				);
-
-		git_commit__free(commit);
-	}
-
-	git_repository_free(repo);
-END_TEST
-
-static const char *commit_ids[] = {
-	"a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
-	"9fd738e8f7967c078dceed8190330fc8648ee56a", /* 1 */
-	"4a202b346bb0fb0db7eff3cffeb3c70babbd2045", /* 2 */
-	"c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */
-	"8496071c1b46c854b31185ea97743be6a8774479", /* 4 */
-	"5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 5 */
-};
-
-BEGIN_TEST(details0, "query the details on a parsed commit")
-	const size_t commit_count = sizeof(commit_ids) / sizeof(const char *);
-
-	unsigned int i;
-	git_repository *repo;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	for (i = 0; i < commit_count; ++i) {
-		git_oid id;
-		git_commit *commit;
-
-		const git_signature *author, *committer;
-		const char *message;
-		git_time_t commit_time;
-		unsigned int parents, p;
-		git_commit *parent = NULL, *old_parent = NULL;
-
-		git_oid_fromstr(&id, commit_ids[i]);
-
-		must_pass(git_commit_lookup(&commit, repo, &id));
-
-		message = git_commit_message(commit);
-		author = git_commit_author(commit);
-		committer = git_commit_committer(commit);
-		commit_time = git_commit_time(commit);
-		parents = git_commit_parentcount(commit);
-
-		must_be_true(strcmp(author->name, "Scott Chacon") == 0);
-		must_be_true(strcmp(author->email, "schacon@gmail.com") == 0);
-		must_be_true(strcmp(committer->name, "Scott Chacon") == 0);
-		must_be_true(strcmp(committer->email, "schacon@gmail.com") == 0);
-		must_be_true(strchr(message, '\n') != NULL);
-		must_be_true(commit_time > 0);
-		must_be_true(parents <= 2);
-		for (p = 0;p < parents;p++) {
-			if (old_parent != NULL)
-				git_commit_close(old_parent);
-
-			old_parent = parent;
-			must_pass(git_commit_parent(&parent, commit, p));
-			must_be_true(parent != NULL);
-			must_be_true(git_commit_author(parent) != NULL); // is it really a commit?
-		}
-		git_commit_close(old_parent);
-		git_commit_close(parent);
-
-		must_fail(git_commit_parent(&parent, commit, parents));
-		git_commit_close(commit);
-	}
-
-	git_repository_free(repo);
-END_TEST
-
-#define COMMITTER_NAME "Vicent Marti"
-#define COMMITTER_EMAIL "vicent@github.com"
-#define COMMIT_MESSAGE "This commit has been created in memory\n\
-This is a commit created in memory and it will be written back to disk\n"
-
-static const char *tree_oid = "1810dff58d8a660512d4832e740f692884338ccd";
-
-BEGIN_TEST(write0, "write a new commit object from memory to disk")
-	git_repository *repo;
-	git_commit *commit;
-	git_oid tree_id, parent_id, commit_id;
-	git_signature *author, *committer;
-	const git_signature *author1, *committer1;
-	git_commit *parent;
-	git_tree *tree;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&tree_id, tree_oid);
-	must_pass(git_tree_lookup(&tree, repo, &tree_id));
-
-	git_oid_fromstr(&parent_id, commit_ids[4]);
-	must_pass(git_commit_lookup(&parent, repo, &parent_id));
-
-	/* create signatures */
-	must_pass(git_signature_new(&committer, COMMITTER_NAME, COMMITTER_EMAIL, 123456789, 60));
-	must_pass(git_signature_new(&author, COMMITTER_NAME, COMMITTER_EMAIL, 987654321, 90));
-
-	must_pass(git_commit_create_v(
-		&commit_id, /* out id */
-		repo,
-		NULL, /* do not update the HEAD */
-		author,
-		committer,
-		NULL,
-		COMMIT_MESSAGE,
-		tree,
-		1, parent));
-
-	git_object_close((git_object *)parent);
-	git_object_close((git_object *)tree);
-
-	git_signature_free(committer);
-	git_signature_free(author);
-
-	must_pass(git_commit_lookup(&commit, repo, &commit_id));
-
-	/* Check attributes were set correctly */
-	author1 = git_commit_author(commit);
-	must_be_true(author1 != NULL);
-	must_be_true(strcmp(author1->name, COMMITTER_NAME) == 0);
-	must_be_true(strcmp(author1->email, COMMITTER_EMAIL) == 0);
-	must_be_true(author1->when.time == 987654321);
-	must_be_true(author1->when.offset == 90);
-
-	committer1 = git_commit_committer(commit);
-	must_be_true(committer1 != NULL);
-	must_be_true(strcmp(committer1->name, COMMITTER_NAME) == 0);
-	must_be_true(strcmp(committer1->email, COMMITTER_EMAIL) == 0);
-	must_be_true(committer1->when.time == 123456789);
-	must_be_true(committer1->when.offset == 60);
-
-	must_be_true(strcmp(git_commit_message(commit), COMMIT_MESSAGE) == 0);
-
-	must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)commit));
-
-	git_commit_close(commit);
-	git_repository_free(repo);
-END_TEST
-
-#define ROOT_COMMIT_MESSAGE "This is a root commit\n\
-This is a root commit and should be the only one in this branch\n"
-
-BEGIN_TEST(root0, "create a root commit")
-	git_repository *repo;
-	git_commit *commit;
-	git_oid tree_id, commit_id;
-	const git_oid *branch_oid;
-	git_signature *author, *committer;
-	const char *branch_name = "refs/heads/root-commit-branch";
-	git_reference *head, *branch;
-	char *head_old;
-	git_tree *tree;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&tree_id, tree_oid);
-	must_pass(git_tree_lookup(&tree, repo, &tree_id));
-
-	/* create signatures */
-	must_pass(git_signature_new(&committer, COMMITTER_NAME, COMMITTER_EMAIL, 123456789, 60));
-	must_pass(git_signature_new(&author, COMMITTER_NAME, COMMITTER_EMAIL, 987654321, 90));
-
-	/* First we need to update HEAD so it points to our non-existant branch */
-	must_pass(git_reference_lookup(&head, repo, "HEAD"));
-	must_be_true(git_reference_type(head) == GIT_REF_SYMBOLIC);
-	head_old = git__strdup(git_reference_target(head));
-	must_be_true(head_old != NULL);
-
-	must_pass(git_reference_set_target(head, branch_name));
-
-	must_pass(git_commit_create_v(
-		&commit_id, /* out id */
-		repo,
-		"HEAD",
-		author,
-		committer,
-		NULL,
-		ROOT_COMMIT_MESSAGE,
-		tree,
-		0));
-
-	git_object_close((git_object *)tree);
-	git_signature_free(committer);
-	git_signature_free(author);
-
-	/*
-	 * The fact that creating a commit works has already been
-	 * tested. Here we just make sure it's our commit and that it was
-	 * written as a root commit.
-	 */
-	must_pass(git_commit_lookup(&commit, repo, &commit_id));
-	must_be_true(git_commit_parentcount(commit) == 0);
-	must_pass(git_reference_lookup(&branch, repo, branch_name));
-	branch_oid = git_reference_oid(branch);
-	must_pass(git_oid_cmp(branch_oid, &commit_id));
-	must_be_true(!strcmp(git_commit_message(commit), ROOT_COMMIT_MESSAGE));
-
-	/* Remove the data we just added to the repo */
-	must_pass(git_reference_lookup(&head, repo, "HEAD"));
-	must_pass(git_reference_set_target(head, head_old));
-	must_pass(git_reference_delete(branch));
-	must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)commit));
-	free(head_old);
-	git_commit_close(commit);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_SUITE(commit)
-	ADD_TEST(parse0);
-	ADD_TEST(parse1);
-	ADD_TEST(parse2);
-	ADD_TEST(details0);
-
-	ADD_TEST(write0);
-
-	ADD_TEST(root0);
-
-	ADD_TEST(signature0);
-	ADD_TEST(signature1);
-	ADD_TEST(signature2);
-	ADD_TEST(signature3);
-	ADD_TEST(signature4);
-END_SUITE
diff --git a/tests/t05-revwalk.c b/tests/t05-revwalk.c
deleted file mode 100644
index ab509ab..0000000
--- a/tests/t05-revwalk.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-/*
-	$ git log --oneline --graph --decorate
-	*   a4a7dce (HEAD, br2) Merge branch 'master' into br2
-	|\
-	| * 9fd738e (master) a fourth commit
-	| * 4a202b3 a third commit
-	* | c47800c branch commit one
-	|/
-	* 5b5b025 another commit
-	* 8496071 testing
-*/
-static const char *commit_head = "a4a7dce85cf63874e984719f4fdd239f5145052f";
-
-static const char *commit_ids[] = {
-	"a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
-	"9fd738e8f7967c078dceed8190330fc8648ee56a", /* 1 */
-	"4a202b346bb0fb0db7eff3cffeb3c70babbd2045", /* 2 */
-	"c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */
-	"8496071c1b46c854b31185ea97743be6a8774479", /* 4 */
-	"5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 5 */
-};
-
-/* Careful: there are two possible topological sorts */
-static const int commit_sorting_topo[][6] = {
-	{0, 1, 2, 3, 5, 4}, {0, 3, 1, 2, 5, 4}
-};
-
-static const int commit_sorting_time[][6] = {
-	{0, 3, 1, 2, 5, 4}
-};
-
-static const int commit_sorting_topo_reverse[][6] = {
-	{4, 5, 3, 2, 1, 0}, {4, 5, 2, 1, 3, 0}
-};
-
-static const int commit_sorting_time_reverse[][6] = {
-	{4, 5, 2, 1, 3, 0}
-};
-
-#define commit_count 6
-static const int result_bytes = 24;
-
-
-static int get_commit_index(git_oid *raw_oid)
-{
-	int i;
-	char oid[40];
-
-	git_oid_fmt(oid, raw_oid);
-
-	for (i = 0; i < commit_count; ++i)
-		if (memcmp(oid, commit_ids[i], 40) == 0)
-			return i;
-
-	return -1;
-}
-
-static int test_walk(git_revwalk *walk, const git_oid *root,
-		int flags, const int possible_results[][6], int results_count)
-{
-	git_oid oid;
-
-	int i;
-	int result_array[commit_count];
-
-	git_revwalk_sorting(walk, flags);
-	git_revwalk_push(walk, root);
-
-	for (i = 0; i < commit_count; ++i)
-		result_array[i] = -1;
-
-	i = 0;
-
-	while (git_revwalk_next(&oid, walk) == GIT_SUCCESS) {
-		result_array[i++] = get_commit_index(&oid);
-		/*{
-			char str[41];
-			git_oid_fmt(str, &oid);
-			str[40] = 0;
-			printf("  %d) %s\n", i, str);
-		}*/
-	}
-
-	for (i = 0; i < results_count; ++i)
-		if (memcmp(possible_results[i],
-				result_array, result_bytes) == 0)
-			return GIT_SUCCESS;
-
-	return GIT_ERROR;
-}
-
-BEGIN_TEST(walk0, "do a simple walk on a repo with different sorting modes")
-	git_oid id;
-	git_repository *repo;
-	git_revwalk *walk;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_revwalk_new(&walk, repo));
-
-	git_oid_fromstr(&id, commit_head);
-
-	must_pass(test_walk(walk, &id, GIT_SORT_TIME, commit_sorting_time, 1));
-	must_pass(test_walk(walk, &id, GIT_SORT_TOPOLOGICAL, commit_sorting_topo, 2));
-	must_pass(test_walk(walk, &id, GIT_SORT_TIME | GIT_SORT_REVERSE, commit_sorting_time_reverse, 1));
-	must_pass(test_walk(walk, &id, GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE, commit_sorting_topo_reverse, 2));
-
-	git_revwalk_free(walk);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_SUITE(revwalk)
-	ADD_TEST(walk0);
-END_SUITE
diff --git a/tests/t06-index.c b/tests/t06-index.c
deleted file mode 100644
index 621e742..0000000
--- a/tests/t06-index.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include "index.h"
-
-#define TEST_INDEX_ENTRY_COUNT 109
-#define TEST_INDEX2_ENTRY_COUNT 1437
-
-struct test_entry {
-	unsigned int index;
-	char path[128];
-	git_off_t file_size;
-	git_time_t mtime;
-};
-
-struct test_entry TEST_ENTRIES[] = {
-	{4, "Makefile", 5064, 0x4C3F7F33},
-	{62, "tests/Makefile", 2631, 0x4C3F7F33},
-	{36, "src/index.c", 10014, 0x4C43368D},
-	{6, "git.git-authors", 2709, 0x4C3F7F33},
-	{48, "src/revobject.h", 1448, 0x4C3F7FE2}
-};
-
-BEGIN_TEST(read0, "load an empty index")
-	git_index *index;
-
-	must_pass(git_index_open(&index, "in-memory-index"));
-	must_be_true(index->on_disk == 0);
-
-	must_be_true(git_index_entrycount(index) == 0);
-	must_be_true(index->entries.sorted);
-
-	git_index_free(index);
-END_TEST
-
-BEGIN_TEST(read1, "load a standard index (default test index)")
-	git_index *index;
-	unsigned int i;
-	git_index_entry **entries;
-
-	must_pass(git_index_open(&index, TEST_INDEX_PATH));
-	must_be_true(index->on_disk);
-
-	must_be_true(git_index_entrycount(index) == TEST_INDEX_ENTRY_COUNT);
-	must_be_true(index->entries.sorted);
-
-	entries = (git_index_entry **)index->entries.contents;
-
-	for (i = 0; i < ARRAY_SIZE(TEST_ENTRIES); ++i) {
-		git_index_entry *e = entries[TEST_ENTRIES[i].index];
-
-		must_be_true(strcmp(e->path, TEST_ENTRIES[i].path) == 0);
-		must_be_true(e->mtime.seconds == TEST_ENTRIES[i].mtime);
-		must_be_true(e->file_size == TEST_ENTRIES[i].file_size);
-	}
-
-	git_index_free(index);
-END_TEST
-
-BEGIN_TEST(read2, "load a standard index (git.git index)")
-	git_index *index;
-
-	must_pass(git_index_open(&index, TEST_INDEX2_PATH));
-	must_be_true(index->on_disk);
-
-	must_be_true(git_index_entrycount(index) == TEST_INDEX2_ENTRY_COUNT);
-	must_be_true(index->entries.sorted);
-	must_be_true(index->tree != NULL);
-
-	git_index_free(index);
-END_TEST
-
-BEGIN_TEST(find0, "find an entry on an index")
-	git_index *index;
-	unsigned int i;
-
-	must_pass(git_index_open(&index, TEST_INDEX_PATH));
-
-	for (i = 0; i < ARRAY_SIZE(TEST_ENTRIES); ++i) {
-		int idx = git_index_find(index, TEST_ENTRIES[i].path);
-		must_be_true((unsigned int)idx == TEST_ENTRIES[i].index);
-	}
-
-	git_index_free(index);
-END_TEST
-
-BEGIN_TEST(find1, "find an entry in an empty index")
-	git_index *index;
-	unsigned int i;
-
-	must_pass(git_index_open(&index, "fake-index"));
-
-	for (i = 0; i < ARRAY_SIZE(TEST_ENTRIES); ++i) {
-		int idx = git_index_find(index, TEST_ENTRIES[i].path);
-		must_be_true(idx == GIT_ENOTFOUND);
-	}
-
-	git_index_free(index);
-END_TEST
-
-BEGIN_TEST(write0, "write an index back to disk")
-	git_index *index;
-
-	must_pass(copy_file(TEST_INDEXBIG_PATH, "index_rewrite"));
-
-	must_pass(git_index_open(&index, "index_rewrite"));
-	must_be_true(index->on_disk);
-
-	must_pass(git_index_write(index));
-	must_pass(cmp_files(TEST_INDEXBIG_PATH, "index_rewrite"));
-
-	git_index_free(index);
-
-	p_unlink("index_rewrite");
-END_TEST
-
-BEGIN_TEST(sort0, "sort the entires in an index")
-	/*
-	 * TODO: This no longer applies:
-	 * index sorting in Git uses some specific changes to the way
-	 * directories are sorted.
-	 *
-	 * We need to specificially check for this by creating a new
-	 * index, adding entries in random order and then
-	 * checking for consistency
-	 */
-END_TEST
-
-BEGIN_TEST(sort1, "sort the entires in an empty index")
-	git_index *index;
-
-	must_pass(git_index_open(&index, "fake-index"));
-
-	/* FIXME: this test is slightly dumb */
-	must_be_true(index->entries.sorted);
-
-	git_index_free(index);
-END_TEST
-
-BEGIN_TEST(add0, "add a new file to the index")
-	git_index *index;
-	git_filebuf file;
-	git_repository *repo;
-	git_index_entry *entry;
-	git_oid id1;
-
-	/* Intialize a new repository */
-	must_pass(git_repository_init(&repo, TEMP_REPO_FOLDER "myrepo", 0));
-
-	/* Ensure we're the only guy in the room */
-	must_pass(git_repository_index(&index, repo));
-	must_pass(git_index_entrycount(index) == 0);
-
-	/* Create a new file in the working directory */
-	must_pass(git_futils_mkpath2file(TEMP_REPO_FOLDER "myrepo/test.txt"));
-	must_pass(git_filebuf_open(&file, TEMP_REPO_FOLDER "myrepo/test.txt", 0));
-	must_pass(git_filebuf_write(&file, "hey there\n", 10));
-	must_pass(git_filebuf_commit(&file));
-
-	/* Store the expected hash of the file/blob
-	 * This has been generated by executing the following
-	 * $ echo "hey there" | git hash-object --stdin
-	 */
-	must_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6"));
-
-	/* Add the new file to the index */
-	must_pass(git_index_add(index, "test.txt", 0));
-
-	/* Wow... it worked! */
-	must_pass(git_index_entrycount(index) == 1);
-	entry = git_index_get(index, 0);
-
-	/* And the built-in hashing mechanism worked as expected */
-    must_be_true(git_oid_cmp(&id1, &entry->oid) == 0);
-
-    git_index_free(index);
-	git_repository_free(repo);
-	must_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, 1));
-END_TEST
-
-BEGIN_SUITE(index)
-	ADD_TEST(read0);
-	ADD_TEST(read1);
-	ADD_TEST(read2);
-
-	ADD_TEST(find0);
-	ADD_TEST(find1);
-
-	ADD_TEST(write0);
-
-	ADD_TEST(sort0);
-	ADD_TEST(sort1);
-
-	ADD_TEST(add0);
-END_SUITE
diff --git a/tests/t07-hashtable.c b/tests/t07-hashtable.c
deleted file mode 100644
index 7313f2c..0000000
--- a/tests/t07-hashtable.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include "hashtable.h"
-#include "hash.h"
-
-typedef struct _aux_object {
-	int __bulk;
-	git_oid id;
-	int visited;
-} table_item;
-
-uint32_t hash_func(const void *key, int hash_id)
-{
-	uint32_t r;
-	const git_oid *id = key;
-
-	memcpy(&r, id->id + (hash_id * sizeof(uint32_t)), sizeof(r));
-	return r;
-}
-
-int hash_cmpkey(const void *a, const void *b)
-{
-	return git_oid_cmp(a, b);
-}
-
-BEGIN_TEST(table0, "create a new hashtable")
-
-	git_hashtable *table = NULL;
-
-	table = git_hashtable_alloc(55, hash_func, hash_cmpkey);
-	must_be_true(table != NULL);
-	must_be_true(table->size_mask + 1 == 64);
-
-	git_hashtable_free(table);
-
-END_TEST
-
-BEGIN_TEST(table1, "fill the hashtable with random entries")
-
-	const int objects_n = 32;
-	int i;
-
-	table_item *objects;
-	git_hashtable *table = NULL;
-
-	table = git_hashtable_alloc(objects_n * 2, hash_func, hash_cmpkey);
-	must_be_true(table != NULL);
-
-	objects = git__malloc(objects_n * sizeof(table_item));
-	memset(objects, 0x0, objects_n * sizeof(table_item));
-
-	/* populate the hash table */
-	for (i = 0; i < objects_n; ++i) {
-		git_hash_buf(&(objects[i].id), &i, sizeof(int));
-		must_pass(git_hashtable_insert(table, &(objects[i].id), &(objects[i])));
-	}
-
-	/* make sure all the inserted objects can be found */
-	for (i = 0; i < objects_n; ++i) {
-		git_oid id;
-		table_item *ob;
-
-		git_hash_buf(&id, &i, sizeof(int));
-		ob = (table_item *)git_hashtable_lookup(table, &id);
-
-		must_be_true(ob != NULL);
-		must_be_true(ob == &(objects[i]));
-	}
-
-	/* make sure we cannot find inexisting objects */
-	for (i = 0; i < 50; ++i) {
-		int hash_id;
-		git_oid id;
-
-		hash_id = (rand() % 50000) + objects_n;
-		git_hash_buf(&id, &hash_id, sizeof(int));
-		must_be_true(git_hashtable_lookup(table, &id) == NULL);
-	}
-
-	git_hashtable_free(table);
-	free(objects);
-
-END_TEST
-
-
-BEGIN_TEST(table2, "make sure the table resizes automatically")
-
-	const int objects_n = 64;
-	int i;
-	unsigned int old_size;
-	table_item *objects;
-	git_hashtable *table = NULL;
-
-	table = git_hashtable_alloc(objects_n, hash_func, hash_cmpkey);
-	must_be_true(table != NULL);
-
-	objects = git__malloc(objects_n * sizeof(table_item));
-	memset(objects, 0x0, objects_n * sizeof(table_item));
-
-	old_size = table->size_mask + 1;
-
-	/* populate the hash table -- should be automatically resized */
-	for (i = 0; i < objects_n; ++i) {
-		git_hash_buf(&(objects[i].id), &i, sizeof(int));
-		must_pass(git_hashtable_insert(table, &(objects[i].id), &(objects[i])));
-	}
-
-	must_be_true(table->size_mask > old_size);
-
-	/* make sure all the inserted objects can be found */
-	for (i = 0; i < objects_n; ++i) {
-		git_oid id;
-		table_item *ob;
-
-		git_hash_buf(&id, &i, sizeof(int));
-		ob = (table_item *)git_hashtable_lookup(table, &id);
-
-		must_be_true(ob != NULL);
-		must_be_true(ob == &(objects[i]));
-	}
-
-	git_hashtable_free(table);
-	free(objects);
-
-END_TEST
-
-BEGIN_TEST(tableit0, "iterate through all the contents of the table")
-
-	const int objects_n = 32;
-	int i;
-	table_item *objects, *ob;
-	const void *GIT_UNUSED(_unused);
-
-	git_hashtable *table = NULL;
-
-	table = git_hashtable_alloc(objects_n * 2, hash_func, hash_cmpkey);
-	must_be_true(table != NULL);
-
-	objects = git__malloc(objects_n * sizeof(table_item));
-	memset(objects, 0x0, objects_n * sizeof(table_item));
-
-	/* populate the hash table */
-	for (i = 0; i < objects_n; ++i) {
-		git_hash_buf(&(objects[i].id), &i, sizeof(int));
-		must_pass(git_hashtable_insert(table, &(objects[i].id), &(objects[i])));
-	}
-
-	GIT_HASHTABLE_FOREACH(table, _unused, ob,
-		ob->visited = 1;
-	);
-
-	/* make sure all nodes have been visited */
-	for (i = 0; i < objects_n; ++i)
-		must_be_true(objects[i].visited);
-
-	git_hashtable_free(table);
-	free(objects);
-END_TEST
-
-
-BEGIN_SUITE(hashtable)
-	ADD_TEST(table0);
-	ADD_TEST(table1);
-	ADD_TEST(table2);
-	ADD_TEST(tableit0);
-END_SUITE
-
diff --git a/tests/t08-tag.c b/tests/t08-tag.c
deleted file mode 100644
index b0d4af8..0000000
--- a/tests/t08-tag.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include "tag.h"
-
-static const char *tag1_id = "b25fa35b38051e4ae45d4222e795f9df2e43f1d1";
-static const char *tag2_id = "7b4384978d2493e851f9cca7858815fac9b10980";
-static const char *tagged_commit = "e90810b8df3e80c413d903f631643c716887138d";
-
-BEGIN_TEST(read0, "read and parse a tag from the repository")
-	git_repository *repo;
-	git_tag *tag1, *tag2;
-	git_commit *commit;
-	git_oid id1, id2, id_commit;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&id1, tag1_id);
-	git_oid_fromstr(&id2, tag2_id);
-	git_oid_fromstr(&id_commit, tagged_commit);
-
-	must_pass(git_tag_lookup(&tag1, repo, &id1));
-
-	must_be_true(strcmp(git_tag_name(tag1), "test") == 0);
-	must_be_true(git_tag_type(tag1) == GIT_OBJ_TAG);
-
-	must_pass(git_tag_target((git_object **)&tag2, tag1));
-	must_be_true(tag2 != NULL);
-
-	must_be_true(git_oid_cmp(&id2, git_tag_id(tag2)) == 0);
-
-	must_pass(git_tag_target((git_object **)&commit, tag2));
-	must_be_true(commit != NULL);
-
-	must_be_true(git_oid_cmp(&id_commit, git_commit_id(commit)) == 0);
-
-	git_tag_close(tag1);
-	git_tag_close(tag2);
-	git_commit_close(commit);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(read1, "list all tag names from the repository")
-	git_repository *repo;
-	git_strarray tag_list;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_tag_list(&tag_list, repo));
-
-	must_be_true(tag_list.count == 3);
-
-	git_strarray_free(&tag_list);
-	git_repository_free(repo);
-END_TEST
-
-static int ensure_tag_pattern_match(git_repository *repo, const char *pattern, const size_t expected_matches)
-{
-	git_strarray tag_list;
-	int error = GIT_SUCCESS;
-
-	if ((error = git_tag_list_match(&tag_list, pattern, repo)) < GIT_SUCCESS)
-		goto exit;
-
-	if (tag_list.count != expected_matches)
-		error = GIT_ERROR;
-
-exit:
-	git_strarray_free(&tag_list);
-	return error;
-}
-
-BEGIN_TEST(read2, "list all tag names from the repository matching a specified pattern")
-	git_repository *repo;
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(ensure_tag_pattern_match(repo, "", 3));
-	must_pass(ensure_tag_pattern_match(repo, "*", 3));
-	must_pass(ensure_tag_pattern_match(repo, "t*", 1));
-	must_pass(ensure_tag_pattern_match(repo, "*b", 2));
-	must_pass(ensure_tag_pattern_match(repo, "e", 0));
-	must_pass(ensure_tag_pattern_match(repo, "e90810b", 1));
-	must_pass(ensure_tag_pattern_match(repo, "e90810[ab]", 1));
-	git_repository_free(repo);
-END_TEST
-
-
-#define TAGGER_NAME "Vicent Marti"
-#define TAGGER_EMAIL "vicent@github.com"
-#define TAGGER_MESSAGE "This is my tag.\n\nThere are many tags, but this one is mine\n"
-
-BEGIN_TEST(write0, "write a tag to the repository and read it again")
-	git_repository *repo;
-	git_tag *tag;
-	git_oid target_id, tag_id;
-	git_signature *tagger;
-	const git_signature *tagger1;
-	git_reference *ref_tag;
-	git_object *target;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&target_id, tagged_commit);
-	must_pass(git_object_lookup(&target, repo, &target_id, GIT_OBJ_COMMIT));
-
-	/* create signature */
-	must_pass(git_signature_new(&tagger, TAGGER_NAME, TAGGER_EMAIL, 123456789, 60));
-
-	must_pass(git_tag_create(
-		&tag_id, /* out id */
-		repo,
-		"the-tag",
-		target,
-		tagger,
-		TAGGER_MESSAGE,
-		0));
-
-	git_object_close(target);
-	git_signature_free(tagger);
-
-	must_pass(git_tag_lookup(&tag, repo, &tag_id));
-	must_be_true(git_oid_cmp(git_tag_target_oid(tag), &target_id) == 0);
-
-	/* Check attributes were set correctly */
-	tagger1 = git_tag_tagger(tag);
-	must_be_true(tagger1 != NULL);
-	must_be_true(strcmp(tagger1->name, TAGGER_NAME) == 0);
-	must_be_true(strcmp(tagger1->email, TAGGER_EMAIL) == 0);
-	must_be_true(tagger1->when.time == 123456789);
-	must_be_true(tagger1->when.offset == 60);
-
-	must_be_true(strcmp(git_tag_message(tag), TAGGER_MESSAGE) == 0);
-
-	must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/the-tag"));
-	must_be_true(git_oid_cmp(git_reference_oid(ref_tag), &tag_id) == 0);
-	must_pass(git_reference_delete(ref_tag));
-
-	must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)tag));
-
-	git_tag_close(tag);
-	git_repository_free(repo);
-
-END_TEST
-
-BEGIN_TEST(write2, "Attempt to write a tag bearing the same name than an already existing tag")
-	git_repository *repo;
-	git_oid target_id, tag_id;
-	git_signature *tagger;
-	git_object *target;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&target_id, tagged_commit);
-	must_pass(git_object_lookup(&target, repo, &target_id, GIT_OBJ_COMMIT));
-
-	/* create signature */
-	must_pass(git_signature_new(&tagger, TAGGER_NAME, TAGGER_EMAIL, 123456789, 60));
-
-	must_fail(git_tag_create(
-		&tag_id, /* out id */
-		repo,
-		"e90810b",
-		target,
-		tagger,
-		TAGGER_MESSAGE,
-		0));
-
-	git_object_close(target);
-	git_signature_free(tagger);
-
-	git_repository_free(repo);
-
-END_TEST
-
-BEGIN_TEST(write3, "Replace an already existing tag")
-	git_repository *repo;
-	git_oid target_id, tag_id, old_tag_id;
-	git_signature *tagger;
-	git_reference *ref_tag;
-	git_object *target;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&target_id, tagged_commit);
-	must_pass(git_object_lookup(&target, repo, &target_id, GIT_OBJ_COMMIT));
-
-	must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/e90810b"));
-	git_oid_cpy(&old_tag_id, git_reference_oid(ref_tag));
-
-	/* create signature */
-	must_pass(git_signature_new(&tagger, TAGGER_NAME, TAGGER_EMAIL, 123456789, 60));
-
-	must_pass(git_tag_create(
-		&tag_id, /* out id */
-		repo,
-		"e90810b",
-		target,
-		tagger,
-		TAGGER_MESSAGE,
-		1));
-
-	git_object_close(target);
-	git_signature_free(tagger);
-
-	must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/e90810b"));
-	must_be_true(git_oid_cmp(git_reference_oid(ref_tag), &tag_id) == 0);
-	must_be_true(git_oid_cmp(git_reference_oid(ref_tag), &old_tag_id) != 0);
-
-	close_temp_repo(repo);
-
-END_TEST
-
-BEGIN_TEST(write4, "write a lightweight tag to the repository and read it again")
-	git_repository *repo;
-	git_oid target_id, object_id;
-	git_reference *ref_tag;
-	git_object *target;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&target_id, tagged_commit);
-	must_pass(git_object_lookup(&target, repo, &target_id, GIT_OBJ_COMMIT));
-
-	must_pass(git_tag_create_lightweight(
-		&object_id,
-		repo,
-		"light-tag",
-		target,
-		0));
-
-	git_object_close(target);
-
-	must_be_true(git_oid_cmp(&object_id, &target_id) == 0);
-
-	must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/light-tag"));
-	must_be_true(git_oid_cmp(git_reference_oid(ref_tag), &target_id) == 0);
-
-	must_pass(git_tag_delete(repo, "light-tag"));
-
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(write5, "Attempt to write a lightweight tag bearing the same name than an already existing tag")
-	git_repository *repo;
-	git_oid target_id, object_id, existing_object_id;
-	git_object *target;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&target_id, tagged_commit);
-	must_pass(git_object_lookup(&target, repo, &target_id, GIT_OBJ_COMMIT));
-
-	must_fail(git_tag_create_lightweight(
-		&object_id,
-		repo,
-		"e90810b",
-		target,
-		0));
-
-	git_oid_fromstr(&existing_object_id, tag2_id);
-	must_be_true(git_oid_cmp(&object_id, &existing_object_id) == 0);
-
-	git_object_close(target);
-
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(delete0, "Delete an already existing tag")
-	git_repository *repo;
-	git_reference *ref_tag;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_tag_delete(repo, "e90810b"));
-
-	must_fail(git_reference_lookup(&ref_tag, repo, "refs/tags/e90810b"));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_SUITE(tag)
-	ADD_TEST(read0);
-	ADD_TEST(read1);
-	ADD_TEST(read2);
-
-	ADD_TEST(write0);
-	ADD_TEST(write2);
-	ADD_TEST(write3);
-	ADD_TEST(write4);
-	ADD_TEST(write5);
-
-	ADD_TEST(delete0);
-
-END_SUITE
diff --git a/tests/t09-tree.c b/tests/t09-tree.c
deleted file mode 100644
index 543aea8..0000000
--- a/tests/t09-tree.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include "tree.h"
-
-static const char *tree_oid = "1810dff58d8a660512d4832e740f692884338ccd";
-
-static const char *blob_oid = "fa49b077972391ad58037050f2a75f74e3671e92";
-static const char *first_tree  = "181037049a54a1eb5fab404658a3a250b44335d7";
-static const char *second_tree = "f60079018b664e4e79329a7ef9559c8d9e0378d1";
-static const char *third_tree = "eb86d8b81d6adbd5290a935d6c9976882de98488";
-
-#if 0
-static int print_tree(git_repository *repo, const git_oid *tree_oid, int depth)
-{
-	static const char *indent = "                              ";
-	git_tree *tree;
-	unsigned int i;
-
-	if (git_tree_lookup(&tree, repo, tree_oid) < GIT_SUCCESS)
-		return GIT_ERROR;
-
-	for (i = 0; i < git_tree_entrycount(tree); ++i) {
-		const git_tree_entry *entry = git_tree_entry_byindex(tree, i);
-		char entry_oid[40];
-
-		git_oid_fmt(entry_oid, &entry->oid);
-		printf("%.*s%o [%.*s] %s\n", depth*2, indent, entry->attr, 40, entry_oid, entry->filename);
-
-		if (entry->attr == S_IFDIR) {
-			if (print_tree(repo, &entry->oid, depth + 1) < GIT_SUCCESS) {
-				git_tree_close(tree);
-				return GIT_ERROR;
-			}
-		}
-	}
-
-	git_tree_close(tree);
-	return GIT_SUCCESS;
-}
-#endif
-
-BEGIN_TEST(read0, "acces randomly the entries on a loaded tree")
-	git_oid id;
-	git_repository *repo;
-	git_tree *tree;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&id, tree_oid);
-
-	must_pass(git_tree_lookup(&tree, repo, &id));
-
-	must_be_true(git_tree_entry_byname(tree, "README") != NULL);
-	must_be_true(git_tree_entry_byname(tree, "NOTEXISTS") == NULL);
-	must_be_true(git_tree_entry_byname(tree, "") == NULL);
-	must_be_true(git_tree_entry_byindex(tree, 0) != NULL);
-	must_be_true(git_tree_entry_byindex(tree, 2) != NULL);
-	must_be_true(git_tree_entry_byindex(tree, 3) == NULL);
-	must_be_true(git_tree_entry_byindex(tree, (unsigned int)-1) == NULL);
-
-	git_tree_close(tree);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(read1, "read a tree from the repository")
-	git_oid id;
-	git_repository *repo;
-	git_tree *tree;
-	const git_tree_entry *entry;
-	git_object *obj;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	git_oid_fromstr(&id, tree_oid);
-
-	must_pass(git_tree_lookup(&tree, repo, &id));
-
-	must_be_true(git_tree_entrycount(tree) == 3);
-
-	/* GH-86: git_object_lookup() should also check the type if the object comes from the cache */
-	must_be_true(git_object_lookup(&obj, repo, &id, GIT_OBJ_TREE) == 0);
-	must_be_true(obj != NULL);
-	git_object_close(obj);
-	obj = NULL;
-	must_be_true(git_object_lookup(&obj, repo, &id, GIT_OBJ_BLOB) == GIT_EINVALIDTYPE);
-	must_be_true(obj == NULL);
-
-	entry = git_tree_entry_byname(tree, "README");
-	must_be_true(entry != NULL);
-
-	must_be_true(strcmp(git_tree_entry_name(entry), "README") == 0);
-
-	must_pass(git_tree_entry_2object(&obj, repo, entry));
-	must_be_true(obj != NULL);
-
-	git_object_close(obj);
-	git_tree_close(tree);
-	git_repository_free(repo);
-END_TEST
-
-#if 0
-BEGIN_TEST(write0, "write a tree from an index")
-	git_repository *repo;
-	git_index *index;
-	git_oid tree_oid;
-
-	must_pass(git_repository_open(&repo, "/tmp/redtmp/.git"));
-	must_pass(git_repository_index(&index, repo));
-
-	must_pass(git_tree_create_fromindex(&tree_oid, index));
-	must_pass(print_tree(repo, &tree_oid, 0));
-
-	git_repository_free(repo);
-END_TEST
-#endif
-
-BEGIN_TEST(write2, "write a tree from a memory")
-	git_repository *repo;
-	git_treebuilder *builder;
-	git_tree *tree;
-	git_oid id, bid, rid, id2;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-	git_oid_fromstr(&id, first_tree);
-	git_oid_fromstr(&id2, second_tree);
-	git_oid_fromstr(&bid, blob_oid);
-
-	//create a second tree from first tree using `git_treebuilder_insert` on REPOSITORY_FOLDER.
-	must_pass(git_tree_lookup(&tree, repo, &id));
-	must_pass(git_treebuilder_create(&builder, tree));
-
-	must_fail(git_treebuilder_insert(NULL, builder, "", &bid, 0100644));
-	must_fail(git_treebuilder_insert(NULL, builder, "/", &bid, 0100644));
-	must_fail(git_treebuilder_insert(NULL, builder, "folder/new.txt", &bid, 0100644));
-
-	must_pass(git_treebuilder_insert(NULL,builder,"new.txt",&bid,0100644));
-	must_pass(git_treebuilder_write(&rid,repo,builder));
-
-	must_be_true(git_oid_cmp(&rid, &id2) == 0);
-
-	git_treebuilder_free(builder);
-	git_tree_close(tree);
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(write3, "write a hierarchical tree from a memory")
-	git_repository *repo;
-	git_treebuilder *builder;
-	git_tree *tree;
-	git_oid id, bid, subtree_id, id2, id3;
-	git_oid id_hiearar;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-	git_oid_fromstr(&id, first_tree);
-	git_oid_fromstr(&id2, second_tree);
-	git_oid_fromstr(&id3, third_tree);
-	git_oid_fromstr(&bid, blob_oid);
-
-	//create subtree
-	must_pass(git_treebuilder_create(&builder, NULL));
-	must_pass(git_treebuilder_insert(NULL,builder,"new.txt",&bid,0100644));
-	must_pass(git_treebuilder_write(&subtree_id,repo,builder));
-	git_treebuilder_free(builder);
-
-        // create parent tree
-        must_pass(git_tree_lookup(&tree, repo, &id));
-	must_pass(git_treebuilder_create(&builder, tree));
-	must_pass(git_treebuilder_insert(NULL,builder,"new",&subtree_id,040000));
-	must_pass(git_treebuilder_write(&id_hiearar,repo,builder));
-	git_treebuilder_free(builder);
-	git_tree_close(tree);
-
-        must_be_true(git_oid_cmp(&id_hiearar, &id3) == 0);
-
-        // check data is correct
-        must_pass(git_tree_lookup(&tree, repo, &id_hiearar));
-        must_be_true(2 == git_tree_entrycount(tree));
-	git_tree_close(tree);
-
-        close_temp_repo(repo);
-
-END_TEST
-
-BEGIN_SUITE(tree)
-	//ADD_TEST(print0);
-	ADD_TEST(read0);
-	ADD_TEST(read1);
-	//ADD_TEST(write0);
-	//ADD_TEST(write1);
-	ADD_TEST(write2);
-	ADD_TEST(write3);
-END_SUITE
-
diff --git a/tests/t10-refs.c b/tests/t10-refs.c
deleted file mode 100644
index 65fbdd6..0000000
--- a/tests/t10-refs.c
+++ /dev/null
@@ -1,1152 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include "repository.h"
-
-#include "git2/reflog.h"
-#include "reflog.h"
-
-static const char *loose_tag_ref_name = "refs/tags/e90810b";
-static const char *non_existing_tag_ref_name = "refs/tags/i-do-not-exist";
-
-BEGIN_TEST(readtag0, "lookup a loose tag reference")
-	git_repository *repo;
-	git_reference *reference;
-	git_object *object;
-	char ref_name_from_tag_name[GIT_REFNAME_MAX];
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&reference, repo, loose_tag_ref_name));
-	must_be_true(reference->type & GIT_REF_OID);
-	must_be_true((reference->type & GIT_REF_PACKED) == 0);
-	must_be_true(strcmp(reference->name, loose_tag_ref_name) == 0);
-
-	must_pass(git_object_lookup(&object, repo, git_reference_oid(reference), GIT_OBJ_ANY));
-	must_be_true(object != NULL);
-	must_be_true(git_object_type(object) == GIT_OBJ_TAG);
-
-	/* Ensure the name of the tag matches the name of the reference */
-	git_path_join(ref_name_from_tag_name, GIT_REFS_TAGS_DIR, git_tag_name((git_tag *)object));
-	must_be_true(strcmp(ref_name_from_tag_name, loose_tag_ref_name) == 0);
-
-	git_object_close(object);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(readtag1, "lookup a loose tag reference that doesn't exist")
-	git_repository *repo;
-	git_reference *reference;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_fail(git_reference_lookup(&reference, repo, non_existing_tag_ref_name));
-
-	git_repository_free(repo);
-END_TEST
-
-static const char *head_tracker_sym_ref_name = "head-tracker";
-static const char *current_head_target = "refs/heads/master";
-static const char *current_master_tip = "be3563ae3f795b2b4353bcce3a527ad0a4f7f644";
-
-BEGIN_TEST(readsym0, "lookup a symbolic reference")
-	git_repository *repo;
-	git_reference *reference, *resolved_ref;
-	git_object *object;
-	git_oid id;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&reference, repo, GIT_HEAD_FILE));
-	must_be_true(reference->type & GIT_REF_SYMBOLIC);
-	must_be_true((reference->type & GIT_REF_PACKED) == 0);
-	must_be_true(strcmp(reference->name, GIT_HEAD_FILE) == 0);
-
-	must_pass(git_reference_resolve(&resolved_ref, reference));
-	must_be_true(resolved_ref->type == GIT_REF_OID);
-
-	must_pass(git_object_lookup(&object, repo, git_reference_oid(resolved_ref), GIT_OBJ_ANY));
-	must_be_true(object != NULL);
-	must_be_true(git_object_type(object) == GIT_OBJ_COMMIT);
-
-	git_oid_fromstr(&id, current_master_tip);
-	must_be_true(git_oid_cmp(&id, git_object_id(object)) == 0);
-
-	git_object_close(object);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(readsym1, "lookup a nested symbolic reference")
-	git_repository *repo;
-	git_reference *reference, *resolved_ref;
-	git_object *object;
-	git_oid id;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&reference, repo, head_tracker_sym_ref_name));
-	must_be_true(reference->type & GIT_REF_SYMBOLIC);
-	must_be_true((reference->type & GIT_REF_PACKED) == 0);
-	must_be_true(strcmp(reference->name, head_tracker_sym_ref_name) == 0);
-
-	must_pass(git_reference_resolve(&resolved_ref, reference));
-	must_be_true(resolved_ref->type == GIT_REF_OID);
-
-	must_pass(git_object_lookup(&object, repo, git_reference_oid(resolved_ref), GIT_OBJ_ANY));
-	must_be_true(object != NULL);
-	must_be_true(git_object_type(object) == GIT_OBJ_COMMIT);
-
-	git_oid_fromstr(&id, current_master_tip);
-	must_be_true(git_oid_cmp(&id, git_object_id(object)) == 0);
-
-	git_object_close(object);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(readsym2, "lookup the HEAD and resolve the master branch")
-	git_repository *repo;
-	git_reference *reference, *resolved_ref, *comp_base_ref;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&reference, repo, head_tracker_sym_ref_name));
-	must_pass(git_reference_resolve(&resolved_ref, reference));
-	comp_base_ref = resolved_ref;
-
-	must_pass(git_reference_lookup(&reference, repo, GIT_HEAD_FILE));
-	must_pass(git_reference_resolve(&resolved_ref, reference));
-	must_pass(git_oid_cmp(git_reference_oid(comp_base_ref), git_reference_oid(resolved_ref)));
-
-	must_pass(git_reference_lookup(&reference, repo, current_head_target));
-	must_pass(git_reference_resolve(&resolved_ref, reference));
-	must_pass(git_oid_cmp(git_reference_oid(comp_base_ref), git_reference_oid(resolved_ref)));
-
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(readsym3, "lookup the master branch and then the HEAD")
-	git_repository *repo;
-	git_reference *reference, *master_ref, *resolved_ref;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&master_ref, repo, current_head_target));
-	must_pass(git_reference_lookup(&reference, repo, GIT_HEAD_FILE));
-
-	must_pass(git_reference_resolve(&resolved_ref, reference));
-	must_pass(git_oid_cmp(git_reference_oid(master_ref), git_reference_oid(resolved_ref)));
-
-	git_repository_free(repo);
-END_TEST
-
-static const char *packed_head_name = "refs/heads/packed";
-static const char *packed_test_head_name = "refs/heads/packed-test";
-
-BEGIN_TEST(readpacked0, "lookup a packed reference")
-	git_repository *repo;
-	git_reference *reference;
-	git_object *object;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&reference, repo, packed_head_name));
-	must_be_true(reference->type & GIT_REF_OID);
-	must_be_true((reference->type & GIT_REF_PACKED) != 0);
-	must_be_true(strcmp(reference->name, packed_head_name) == 0);
-
-	must_pass(git_object_lookup(&object, repo, git_reference_oid(reference), GIT_OBJ_ANY));
-	must_be_true(object != NULL);
-	must_be_true(git_object_type(object) == GIT_OBJ_COMMIT);
-
-	git_object_close(object);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(readpacked1, "assure that a loose reference is looked up before a packed reference")
-	git_repository *repo;
-	git_reference *reference;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_reference_lookup(&reference, repo, packed_head_name));
-	must_pass(git_reference_lookup(&reference, repo, packed_test_head_name));
-	must_be_true(reference->type & GIT_REF_OID);
-	must_be_true((reference->type & GIT_REF_PACKED) == 0);
-	must_be_true(strcmp(reference->name, packed_test_head_name) == 0);
-
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(create0, "create a new symbolic reference")
-	git_reference *new_reference, *looked_up_ref, *resolved_ref;
-	git_repository *repo, *repo2;
-	git_oid id;
-	char ref_path[GIT_PATH_MAX];
-
-	const char *new_head_tracker = "another-head-tracker";
-
-	git_oid_fromstr(&id, current_master_tip);
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Retrieve the physical path to the symbolic ref for further cleaning */
-	git_path_join(ref_path, repo->path_repository, new_head_tracker);
-
-	/* Create and write the new symbolic reference */
-	must_pass(git_reference_create_symbolic(&new_reference, repo, new_head_tracker, current_head_target, 0));
-
-	/* Ensure the reference can be looked-up... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, new_head_tracker));
-	must_be_true(looked_up_ref->type & GIT_REF_SYMBOLIC);
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) == 0);
-	must_be_true(strcmp(looked_up_ref->name, new_head_tracker) == 0);
-
-	/* ...peeled.. */
-	must_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
-	must_be_true(resolved_ref->type == GIT_REF_OID);
-
-	/* ...and that it points to the current master tip */
-	must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0);
-
-	git_repository_free(repo);
-
-	/* Similar test with a fresh new repository */
-	must_pass(git_repository_open(&repo2, TEMP_REPO_FOLDER));
-
-	must_pass(git_reference_lookup(&looked_up_ref, repo2, new_head_tracker));
-	must_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
-	must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0);
-
-	close_temp_repo(repo2);
-END_TEST
-
-BEGIN_TEST(create1, "create a deep symbolic reference")
-	git_reference *new_reference, *looked_up_ref, *resolved_ref;
-	git_repository *repo;
-	git_oid id;
-	char ref_path[GIT_PATH_MAX];
-
-	const char *new_head_tracker = "deep/rooted/tracker";
-
-	git_oid_fromstr(&id, current_master_tip);
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	git_path_join(ref_path, repo->path_repository, new_head_tracker);
-	must_pass(git_reference_create_symbolic(&new_reference, repo, new_head_tracker, current_head_target, 0));
-	must_pass(git_reference_lookup(&looked_up_ref, repo, new_head_tracker));
-	must_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
-	must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0);
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(create2, "create a new OID reference")
-	git_reference *new_reference, *looked_up_ref;
-	git_repository *repo, *repo2;
-	git_oid id;
-	char ref_path[GIT_PATH_MAX];
-
-	const char *new_head = "refs/heads/new-head";
-
-	git_oid_fromstr(&id, current_master_tip);
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Retrieve the physical path to the symbolic ref for further cleaning */
-	git_path_join(ref_path, repo->path_repository, new_head);
-
-	/* Create and write the new object id reference */
-	must_pass(git_reference_create_oid(&new_reference, repo, new_head, &id, 0));
-
-	/* Ensure the reference can be looked-up... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, new_head));
-	must_be_true(looked_up_ref->type & GIT_REF_OID);
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) == 0);
-	must_be_true(strcmp(looked_up_ref->name, new_head) == 0);
-
-	/* ...and that it points to the current master tip */
-	must_be_true(git_oid_cmp(&id, git_reference_oid(looked_up_ref)) == 0);
-
-	git_repository_free(repo);
-
-	/* Similar test with a fresh new repository */
-	must_pass(git_repository_open(&repo2, TEMP_REPO_FOLDER));
-
-	must_pass(git_reference_lookup(&looked_up_ref, repo2, new_head));
-	must_be_true(git_oid_cmp(&id, git_reference_oid(looked_up_ref)) == 0);
-
-	close_temp_repo(repo2);
-END_TEST
-
-BEGIN_TEST(create3, "Can not create a new OID reference which targets at an unknown id")
-	git_reference *new_reference, *looked_up_ref;
-	git_repository *repo;
-	git_oid id;
-
-	const char *new_head = "refs/heads/new-head";
-
-	git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644");
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	/* Create and write the new object id reference */
-	must_fail(git_reference_create_oid(&new_reference, repo, new_head, &id, 0));
-
-	/* Ensure the reference can't be looked-up... */
-	must_fail(git_reference_lookup(&looked_up_ref, repo, new_head));
-
-	git_repository_free(repo);
-END_TEST
-
-static const char *ref_name = "refs/heads/other";
-static const char *ref_master_name = "refs/heads/master";
-static const char *ref_branch_name = "refs/heads/branch";
-static const char *ref_test_name = "refs/heads/test";
-BEGIN_TEST(overwrite0, "Overwrite an existing symbolic reference")
-	git_reference *ref, *branch_ref;
-	git_repository *repo;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* The target needds to exist and we need to check the name has changed */
-	must_pass(git_reference_create_symbolic(&branch_ref, repo, ref_branch_name, ref_master_name, 0));
-	must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_branch_name, 0));
-	/* Ensure it points to the right place*/
-	must_pass(git_reference_lookup(&ref, repo, ref_name));
-	must_be_true(git_reference_type(ref) & GIT_REF_SYMBOLIC);
-	must_be_true(!strcmp(git_reference_target(ref), ref_branch_name));
-
-	/* Ensure we can't create it unless we force it to */
-	must_fail(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 0));
-	must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 1));
-
-	/* Ensure it points to the right place */
-	must_pass(git_reference_lookup(&ref, repo, ref_name));
-	must_be_true(git_reference_type(ref) & GIT_REF_SYMBOLIC);
-	must_be_true(!strcmp(git_reference_target(ref), ref_master_name));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(overwrite1, "Overwrite an existing object id reference")
-	git_reference *ref;
-	git_repository *repo;
-	git_oid id;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&ref, repo, ref_master_name));
-	must_be_true(ref->type & GIT_REF_OID);
-	git_oid_cpy(&id, git_reference_oid(ref));
-
-	/* Create it */
-	must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
-
-	must_pass(git_reference_lookup(&ref, repo, ref_test_name));
-	must_be_true(ref->type & GIT_REF_OID);
-	git_oid_cpy(&id, git_reference_oid(ref));
-
-	/* Ensure we can't overwrite unless we force it */
-	must_fail(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
-	must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 1));
-
-	/* Ensure it has been overwritten */
-	must_pass(git_reference_lookup(&ref, repo, ref_name));
-	must_be_true(!git_oid_cmp(&id, git_reference_oid(ref)));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(overwrite2, "Overwrite an existing object id reference with a symbolic one")
-	git_reference *ref;
-	git_repository *repo;
-	git_oid id;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&ref, repo, ref_master_name));
-	must_be_true(ref->type & GIT_REF_OID);
-	git_oid_cpy(&id, git_reference_oid(ref));
-
-	must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
-	must_fail(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 0));
-	must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 1));
-
-	/* Ensure it points to the right place */
-	must_pass(git_reference_lookup(&ref, repo, ref_name));
-	must_be_true(git_reference_type(ref) & GIT_REF_SYMBOLIC);
-	must_be_true(!strcmp(git_reference_target(ref), ref_master_name));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(overwrite3, "Overwrite an existing symbolic reference with an object id one")
-	git_reference *ref;
-	git_repository *repo;
-	git_oid id;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&ref, repo, ref_master_name));
-	must_be_true(ref->type & GIT_REF_OID);
-	git_oid_cpy(&id, git_reference_oid(ref));
-
-	/* Create the symbolic ref */
-	must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 0));
-	/* It shouldn't overwrite unless we tell it to */
-	must_fail(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
-	must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 1));
-
-	/* Ensure it points to the right place */
-	must_pass(git_reference_lookup(&ref, repo, ref_name));
-	must_be_true(git_reference_type(ref) & GIT_REF_OID);
-	must_be_true(!git_oid_cmp(git_reference_oid(ref), &id));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(pack0, "create a packfile for an empty folder")
-	git_repository *repo;
-	char temp_path[GIT_PATH_MAX];
-	const int mode = 0755; /* or 0777 ? */
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	git_path_join_n(temp_path, 3, repo->path_repository, GIT_REFS_HEADS_DIR, "empty_dir");
-	must_pass(git_futils_mkdir_r(temp_path, mode));
-
-	must_pass(git_reference_packall(repo));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(pack1, "create a packfile from all the loose rn a repo")
-	git_repository *repo;
-	git_reference *reference;
-	char temp_path[GIT_PATH_MAX];
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Ensure a known loose ref can be looked up */
-	must_pass(git_reference_lookup(&reference, repo, loose_tag_ref_name));
-	must_be_true((reference->type & GIT_REF_PACKED) == 0);
-	must_be_true(strcmp(reference->name, loose_tag_ref_name) == 0);
-
-	/*
-	 * We are now trying to pack also a loose reference
-	 * called `points_to_blob`, to make sure we can properly
-	 * pack weak tags
-	 */
-	must_pass(git_reference_packall(repo));
-
-	/* Ensure the packed-refs file exists */
-	git_path_join(temp_path, repo->path_repository, GIT_PACKEDREFS_FILE);
-	must_pass(git_futils_exists(temp_path));
-
-	/* Ensure the known ref can still be looked up but is now packed */
-	must_pass(git_reference_lookup(&reference, repo, loose_tag_ref_name));
-	must_be_true((reference->type & GIT_REF_PACKED) != 0);
-	must_be_true(strcmp(reference->name, loose_tag_ref_name) == 0);
-
-	/* Ensure the known ref has been removed from the loose folder structure */
-	git_path_join(temp_path, repo->path_repository, loose_tag_ref_name);
-	must_pass(!git_futils_exists(temp_path));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(rename0, "rename a loose reference")
-	git_reference *looked_up_ref, *another_looked_up_ref;
-	git_repository *repo;
-	char temp_path[GIT_PATH_MAX];
-	const char *new_name = "refs/tags/Nemo/knows/refs.kung-fu";
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Ensure the ref doesn't exist on the file system */
-	git_path_join(temp_path, repo->path_repository, new_name);
-	must_pass(!git_futils_exists(temp_path));
-
-	/* Retrieval of the reference to rename */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, loose_tag_ref_name));
-
-	/* ... which is indeed loose */
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) == 0);
-
-	/* Now that the reference is renamed... */
-	must_pass(git_reference_rename(looked_up_ref, new_name, 0));
-	must_be_true(!strcmp(looked_up_ref->name, new_name));
-
-	/* ...It can't be looked-up with the old name... */
-	must_fail(git_reference_lookup(&another_looked_up_ref, repo, loose_tag_ref_name));
-
-	/* ...but the new name works ok... */
-	must_pass(git_reference_lookup(&another_looked_up_ref, repo, new_name));
-	must_be_true(!strcmp(another_looked_up_ref->name, new_name));
-
-	/* .. the ref is still loose... */
-	must_be_true((another_looked_up_ref->type & GIT_REF_PACKED) == 0);
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) == 0);
-
-	/* ...and the ref can be found in the file system */
-	git_path_join(temp_path, repo->path_repository, new_name);
-	must_pass(git_futils_exists(temp_path));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(rename1, "rename a packed reference (should make it loose)")
-	git_reference *looked_up_ref, *another_looked_up_ref;
-	git_repository *repo;
-	char temp_path[GIT_PATH_MAX];
-	const char *brand_new_name = "refs/heads/brand_new_name";
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Ensure the ref doesn't exist on the file system */
-	git_path_join(temp_path, repo->path_repository, packed_head_name);
-	must_pass(!git_futils_exists(temp_path));
-
-	/* The reference can however be looked-up... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
-
-	/* .. and it's packed */
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) != 0);
-
-	/* Now that the reference is renamed... */
-	must_pass(git_reference_rename(looked_up_ref, brand_new_name, 0));
-	must_be_true(!strcmp(looked_up_ref->name, brand_new_name));
-
-	/* ...It can't be looked-up with the old name... */
-	must_fail(git_reference_lookup(&another_looked_up_ref, repo, packed_head_name));
-
-	/* ...but the new name works ok... */
-	must_pass(git_reference_lookup(&another_looked_up_ref, repo, brand_new_name));
-	must_be_true(!strcmp(another_looked_up_ref->name, brand_new_name));
-
-	/* .. the ref is no longer packed... */
-	must_be_true((another_looked_up_ref->type & GIT_REF_PACKED) == 0);
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) == 0);
-
-	/* ...and the ref now happily lives in the file system */
-	git_path_join(temp_path, repo->path_repository, brand_new_name);
-	must_pass(git_futils_exists(temp_path));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(rename2, "renaming a packed reference does not pack another reference which happens to be in both loose and pack state")
-	git_reference *looked_up_ref, *another_looked_up_ref;
-	git_repository *repo;
-	char temp_path[GIT_PATH_MAX];
-	const char *brand_new_name = "refs/heads/brand_new_name";
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Ensure the other reference exists on the file system */
-	git_path_join(temp_path, repo->path_repository, packed_test_head_name);
-	must_pass(git_futils_exists(temp_path));
-
-	/* Lookup the other reference */
-	must_pass(git_reference_lookup(&another_looked_up_ref, repo, packed_test_head_name));
-
-	/* Ensure it's loose */
-	must_be_true((another_looked_up_ref->type & GIT_REF_PACKED) == 0);
-
-	/* Lookup the reference to rename */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
-
-	/* Ensure it's packed */
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) != 0);
-
-	/* Now that the reference is renamed... */
-	must_pass(git_reference_rename(looked_up_ref, brand_new_name, 0));
-
-	/* Lookup the other reference */
-	must_pass(git_reference_lookup(&another_looked_up_ref, repo, packed_test_head_name));
-
-	/* Ensure it's loose */
-	must_be_true((another_looked_up_ref->type & GIT_REF_PACKED) == 0);
-
-	/* Ensure the other ref still exists on the file system */
-	must_pass(git_futils_exists(temp_path));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(rename3, "can not rename a reference with the name of an existing reference")
-	git_reference *looked_up_ref;
-	git_repository *repo;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* An existing reference... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
-
-	/* Can not be renamed to the name of another existing reference. */
-	must_fail(git_reference_rename(looked_up_ref, packed_test_head_name, 0));
-
-	/* Failure to rename it hasn't corrupted its state */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
-	must_be_true(!strcmp(looked_up_ref->name, packed_head_name));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(rename4, "can not rename a reference with an invalid name")
-	git_reference *looked_up_ref;
-	git_repository *repo;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* An existing oid reference... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
-
-	/* Can not be renamed with an invalid name. */
-	must_fail(git_reference_rename(looked_up_ref, "Hello! I'm a very invalid name.", 0));
-
-	/* Can not be renamed outside of the refs hierarchy. */
-	must_fail(git_reference_rename(looked_up_ref, "i-will-sudo-you", 0));
-
-	/* Failure to rename it hasn't corrupted its state */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
-	must_be_true(!strcmp(looked_up_ref->name, packed_test_head_name));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(rename5, "can force-rename a packed reference with the name of an existing loose and packed reference")
-	git_reference *looked_up_ref;
-	git_repository *repo;
-	git_oid oid;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* An existing reference... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
-	git_oid_cpy(&oid, git_reference_oid(looked_up_ref));
-
-	/* Can be force-renamed to the name of another existing reference. */
-	must_pass(git_reference_rename(looked_up_ref, packed_test_head_name, 1));
-
-	/* Check we actually renamed it */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
-	must_be_true(!strcmp(looked_up_ref->name, packed_test_head_name));
-	must_be_true(!git_oid_cmp(&oid, git_reference_oid(looked_up_ref)));
-
-	/* And that the previous one doesn't exist any longer */
-	must_fail(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(rename6, "can force-rename a loose reference with the name of an existing loose reference")
-	git_reference *looked_up_ref;
-	git_repository *repo;
-	git_oid oid;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* An existing reference... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, "refs/heads/br2"));
-	git_oid_cpy(&oid, git_reference_oid(looked_up_ref));
-
-	/* Can be force-renamed to the name of another existing reference. */
-	must_pass(git_reference_rename(looked_up_ref, "refs/heads/test", 1));
-
-	/* Check we actually renamed it */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, "refs/heads/test"));
-	must_be_true(!strcmp(looked_up_ref->name,  "refs/heads/test"));
-	must_be_true(!git_oid_cmp(&oid, git_reference_oid(looked_up_ref)));
-
-	/* And that the previous one doesn't exist any longer */
-	must_fail(git_reference_lookup(&looked_up_ref, repo, "refs/heads/br2"));
-
-	close_temp_repo(repo);
-END_TEST
-
-static const char *ref_one_name = "refs/heads/one/branch";
-static const char *ref_one_name_new = "refs/heads/two/branch";
-static const char *ref_two_name = "refs/heads/two";
-
-BEGIN_TEST(rename7, "can not overwrite name of existing reference")
-	git_reference *ref, *ref_one, *ref_one_new, *ref_two;
-	git_repository *repo;
-	git_oid id;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&ref, repo, ref_master_name));
-	must_be_true(ref->type & GIT_REF_OID);
-
-	git_oid_cpy(&id, git_reference_oid(ref));
-
-	/* Create loose references */
-	must_pass(git_reference_create_oid(&ref_one, repo, ref_one_name, &id, 0));
-	must_pass(git_reference_create_oid(&ref_two, repo, ref_two_name, &id, 0));
-
-	/* Pack everything */
-	must_pass(git_reference_packall(repo));
-
-	/* Attempt to create illegal reference */
-	must_fail(git_reference_create_oid(&ref_one_new, repo, ref_one_name_new, &id, 0));
-
-	/* Illegal reference couldn't be created so this is supposed to fail */
-	must_fail(git_reference_lookup(&ref_one_new, repo, ref_one_name_new));
-
-	close_temp_repo(repo);
-END_TEST
-
-static const char *ref_two_name_new = "refs/heads/two/two";
-
-BEGIN_TEST(rename8, "can be renamed to a new name prefixed with the old name")
-	git_reference *ref, *ref_two, *looked_up_ref;
-	git_repository *repo;
-	git_oid id;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	must_pass(git_reference_lookup(&ref, repo, ref_master_name));
-	must_be_true(ref->type & GIT_REF_OID);
-
-	git_oid_cpy(&id, git_reference_oid(ref));
-
-	/* Create loose references */
-	must_pass(git_reference_create_oid(&ref_two, repo, ref_two_name, &id, 0));
-
-	/* An existing reference... */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, ref_two_name));
-
-	/* Can be rename to a new name starting with the old name. */
-	must_pass(git_reference_rename(looked_up_ref, ref_two_name_new, 0));
-
-	/* Check we actually renamed it */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, ref_two_name_new));
-	must_be_true(!strcmp(looked_up_ref->name, ref_two_name_new));
-	must_fail(git_reference_lookup(&looked_up_ref, repo, ref_two_name));
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_TEST(delete0, "deleting a ref which is both packed and loose should remove both tracks in the filesystem")
-	git_reference *looked_up_ref, *another_looked_up_ref;
-	git_repository *repo;
-	char temp_path[GIT_PATH_MAX];
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Ensure the loose reference exists on the file system */
-	git_path_join(temp_path, repo->path_repository, packed_test_head_name);
-	must_pass(git_futils_exists(temp_path));
-
-	/* Lookup the reference */
-	must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
-
-	/* Ensure it's the loose version that has been found */
-	must_be_true((looked_up_ref->type & GIT_REF_PACKED) == 0);
-
-	/* Now that the reference is deleted... */
-	must_pass(git_reference_delete(looked_up_ref));
-
-	/* Looking up the reference once again should not retrieve it */
-	must_fail(git_reference_lookup(&another_looked_up_ref, repo, packed_test_head_name));
-
-	/* Ensure the loose reference doesn't exist any longer on the file system */
-	must_pass(!git_futils_exists(temp_path));
-
-	close_temp_repo(repo);
-END_TEST
-
-static int ensure_refname_normalized(int is_oid_ref, const char *input_refname, const char *expected_refname)
-{
-	int error = GIT_SUCCESS;
-	char buffer_out[GIT_REFNAME_MAX];
-
-	if (is_oid_ref)
-		error = git_reference__normalize_name_oid(buffer_out, sizeof(buffer_out), input_refname);
-	else
-		error = git_reference__normalize_name(buffer_out, sizeof(buffer_out), input_refname);
-
-	if (error < GIT_SUCCESS)
-		return error;
-
-	if (expected_refname == NULL)
-		return error;
-
-	if (strcmp(buffer_out, expected_refname))
-		error = GIT_ERROR;
-
-	return error;
-}
-
-#define OID_REF 1
-#define SYM_REF 0
-
-BEGIN_TEST(normalize0, "normalize a direct (OID) reference name")
-	must_fail(ensure_refname_normalized(OID_REF, "a", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/a/", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/a.", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/a.lock", NULL));
-	must_pass(ensure_refname_normalized(OID_REF, "refs/dummy/a", NULL));
-	must_pass(ensure_refname_normalized(OID_REF, "refs/stash", NULL));
-	must_pass(ensure_refname_normalized(OID_REF, "refs/tags/a", "refs/tags/a"));
-	must_pass(ensure_refname_normalized(OID_REF, "refs/heads/a/b", "refs/heads/a/b"));
-	must_pass(ensure_refname_normalized(OID_REF, "refs/heads/a./b", "refs/heads/a./b"));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/foo?bar", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads\foo", NULL));
-	must_pass(ensure_refname_normalized(OID_REF, "refs/heads/v@ation", "refs/heads/v@ation"));
-	must_pass(ensure_refname_normalized(OID_REF, "refs///heads///a", "refs/heads/a"));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/.a/b", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/foo/../bar", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/foo..bar", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/./foo", NULL));
-	must_fail(ensure_refname_normalized(OID_REF, "refs/heads/v@{ation", NULL));
-END_TEST
-
-BEGIN_TEST(normalize1, "normalize a symbolic reference name")
-	must_pass(ensure_refname_normalized(SYM_REF, "a", "a"));
-	must_pass(ensure_refname_normalized(SYM_REF, "a/b", "a/b"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs///heads///a", "refs/heads/a"));
-	must_fail(ensure_refname_normalized(SYM_REF, "", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "heads\foo", NULL));
-END_TEST
-
-/* Ported from JGit, BSD licence.
- * See https://github.com/spearce/JGit/commit/e4bf8f6957bbb29362575d641d1e77a02d906739 */
-BEGIN_TEST(normalize2, "tests borrowed from JGit")
-
-/* EmptyString */
-	must_fail(ensure_refname_normalized(SYM_REF, "", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "/", NULL));
-
-/* MustHaveTwoComponents */
-	must_fail(ensure_refname_normalized(OID_REF, "master", NULL));
-	must_pass(ensure_refname_normalized(SYM_REF, "heads/master", "heads/master"));
-
-/* ValidHead */
-
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/master", "refs/heads/master"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/pu", "refs/heads/pu"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/z", "refs/heads/z"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/FoO", "refs/heads/FoO"));
-
-/* ValidTag */
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/tags/v1.0", "refs/tags/v1.0"));
-
-/* NoLockSuffix */
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master.lock", NULL));
-
-/* NoDirectorySuffix */
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master/", NULL));
-
-/* NoSpace */
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/i haz space", NULL));
-
-/* NoAsciiControlCharacters */
-	{
-		char c;
-		char buffer[GIT_REFNAME_MAX];
-		for (c = '\1'; c < ' '; c++) {
-			strncpy(buffer, "refs/heads/mast", 15);
-			strncpy(buffer + 15, (const char *)&c, 1);
-			strncpy(buffer + 16, "er", 2);
-			buffer[18 - 1] = '\0';
-			must_fail(ensure_refname_normalized(SYM_REF, buffer, NULL));
-		}
-	}
-
-/* NoBareDot */
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/.", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/..", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/./master", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/../master", NULL));
-
-/* NoLeadingOrTrailingDot */
-	must_fail(ensure_refname_normalized(SYM_REF, ".", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/.bar", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/..bar", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/bar.", NULL));
-
-/* ContainsDot */
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/m.a.s.t.e.r", "refs/heads/m.a.s.t.e.r"));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master..pu", NULL));
-
-/* NoMagicRefCharacters */
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master^", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/^master", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "^refs/heads/master", NULL));
-
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master~", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/~master", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "~refs/heads/master", NULL));
-
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master:", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/:master", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, ":refs/heads/master", NULL));
-
-/* ShellGlob */
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master?", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/?master", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "?refs/heads/master", NULL));
-
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master[", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/[master", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "[refs/heads/master", NULL));
-
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master*", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/*master", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "*refs/heads/master", NULL));
-
-/* ValidSpecialCharacters */
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/!", "refs/heads/!"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/\"", "refs/heads/\""));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/#", "refs/heads/#"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/$", "refs/heads/$"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/%", "refs/heads/%"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/&", "refs/heads/&"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/'", "refs/heads/'"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/(", "refs/heads/("));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/)", "refs/heads/)"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/+", "refs/heads/+"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/,", "refs/heads/,"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/-", "refs/heads/-"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/;", "refs/heads/;"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/<", "refs/heads/<"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/=", "refs/heads/="));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/>", "refs/heads/>"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/@", "refs/heads/@"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/]", "refs/heads/]"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/_", "refs/heads/_"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/`", "refs/heads/`"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/{", "refs/heads/{"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/|", "refs/heads/|"));
-	must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/}", "refs/heads/}"));
-
-	// This is valid on UNIX, but not on Windows
-	// hence we make in invalid due to non-portability
-	//
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/\\", NULL));
-
-/* UnicodeNames */
-	/*
-	 * Currently this fails.
-	 * must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/\u00e5ngstr\u00f6m", "refs/heads/\u00e5ngstr\u00f6m"));
-	 */
-
-/* RefLogQueryIsValidRef */
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master@{1}", NULL));
-	must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master@{1.hour.ago}", NULL));
-END_TEST
-
-BEGIN_TEST(list0, "try to list all the references in our test repo")
-	git_repository *repo;
-	git_strarray ref_list;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_reference_listall(&ref_list, repo, GIT_REF_LISTALL));
-
-	/*{
-		unsigned short i;
-		for (i = 0; i < ref_list.count; ++i)
-			printf("# %s\n", ref_list.strings[i]);
-	}*/
-
-	/* We have exactly 8 refs in total if we include the packed ones:
-	 * there is a reference that exists both in the packfile and as
-	 * loose, but we only list it once */
-	must_be_true(ref_list.count == 8);
-
-	git_strarray_free(&ref_list);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(list1, "try to list only the symbolic references")
-	git_repository *repo;
-	git_strarray ref_list;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_reference_listall(&ref_list, repo, GIT_REF_SYMBOLIC));
-	must_be_true(ref_list.count == 0); /* no symrefs in the test repo */
-
-	git_strarray_free(&ref_list);
-	git_repository_free(repo);
-END_TEST
-
-static const char *new_ref = "refs/heads/test-reflog";
-#define commit_msg "commit: bla bla"
-
-static int assert_signature(git_signature *expected, git_signature *actual)
-{
-	if (actual == NULL)
-		return GIT_ERROR;
-
-	if (strcmp(expected->name, actual->name) != 0)
-		return GIT_ERROR;
-
-	if (strcmp(expected->email, actual->email) != 0)
-		return GIT_ERROR;
-
-	if (expected->when.offset != actual->when.offset)
-		return GIT_ERROR;
-
-	if (expected->when.time != actual->when.time)
-		return GIT_ERROR;
-
-	return GIT_SUCCESS;
-}
-
-BEGIN_TEST(reflog0, "write a reflog for a given reference and ensure it can be read back")
-	git_repository *repo, *repo2;
-	git_reference *ref, *lookedup_ref;
-	git_oid oid;
-	git_signature *committer;
-	git_reflog *reflog;
-	git_reflog_entry *entry;
-	char oid_str[GIT_OID_HEXSZ+1];
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Create a new branch pointing at the HEAD */
-	git_oid_fromstr(&oid, current_master_tip);
-	must_pass(git_reference_create_oid(&ref, repo, new_ref, &oid, 0));
-	must_pass(git_reference_lookup(&ref, repo, new_ref));
-
-	must_pass(git_signature_now(&committer, "foo", "foo@bar"));
-
-	must_pass(git_reflog_write(ref, NULL, committer, NULL));
-	must_fail(git_reflog_write(ref, NULL, committer, "no ancestor NULL for an existing reflog"));
-	must_fail(git_reflog_write(ref, NULL, committer, "no\nnewline"));
-	must_pass(git_reflog_write(ref, &oid, committer, commit_msg));
-
-	git_repository_free(repo);
-
-	/* Reopen a new instance of the repository */
-	must_pass(git_repository_open(&repo2, TEMP_REPO_FOLDER));
-
-	/* Lookup the preivously created branch */
-	must_pass(git_reference_lookup(&lookedup_ref, repo2, new_ref));
-
-	/* Read and parse the reflog for this branch */
-	must_pass(git_reflog_read(&reflog, lookedup_ref));
-	must_be_true(reflog->entries.length == 2);
-
-	entry = (git_reflog_entry *)git_vector_get(&reflog->entries, 0);
-	must_pass(assert_signature(committer, entry->committer));
-	git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_old);
-	must_be_true(strcmp("0000000000000000000000000000000000000000", oid_str) == 0);
-	git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_cur);
-	must_be_true(strcmp(current_master_tip, oid_str) == 0);
-	must_be_true(entry->msg == NULL);
-
-	entry = (git_reflog_entry *)git_vector_get(&reflog->entries, 1);
-	must_pass(assert_signature(committer, entry->committer));
-	git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_old);
-	must_be_true(strcmp(current_master_tip, oid_str) == 0);
-	git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_cur);
-	must_be_true(strcmp(current_master_tip, oid_str) == 0);
-	must_be_true(strcmp(commit_msg, entry->msg) == 0);
-
-	git_signature_free(committer);
-	git_reflog_free(reflog);
-	close_temp_repo(repo2);
-END_TEST
-
-BEGIN_TEST(reflog1, "avoid writing an obviously wrong reflog")
-	git_repository *repo;
-	git_reference *ref;
-	git_oid oid;
-	git_signature *committer;
-
-	must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
-	/* Create a new branch pointing at the HEAD */
-	git_oid_fromstr(&oid, current_master_tip);
-	must_pass(git_reference_create_oid(&ref, repo, new_ref, &oid, 0));
-	must_pass(git_reference_lookup(&ref, repo, new_ref));
-
-	must_pass(git_signature_now(&committer, "foo", "foo@bar"));
-
-	/* Write the reflog for the new branch */
-	must_pass(git_reflog_write(ref, NULL, committer, NULL));
-
-	/* Try to update the reflog with wrong information:
-	 * It's no new reference, so the ancestor OID cannot
-	 * be NULL. */
-	must_fail(git_reflog_write(ref, NULL, committer, NULL));
-
-	git_signature_free(committer);
-
-	close_temp_repo(repo);
-END_TEST
-
-BEGIN_SUITE(refs)
-	ADD_TEST(readtag0);
-	ADD_TEST(readtag1);
-
-	ADD_TEST(readsym0);
-	ADD_TEST(readsym1);
-	ADD_TEST(readsym2);
-	ADD_TEST(readsym3);
-
-	ADD_TEST(readpacked0);
-	ADD_TEST(readpacked1);
-
-	ADD_TEST(create0);
-	ADD_TEST(create1);
-	ADD_TEST(create2);
-	ADD_TEST(create3);
-
-	ADD_TEST(overwrite0);
-	ADD_TEST(overwrite1);
-	ADD_TEST(overwrite2);
-	ADD_TEST(overwrite3);
-
-	ADD_TEST(normalize0);
-	ADD_TEST(normalize1);
-	ADD_TEST(normalize2);
-
-	ADD_TEST(pack0);
-	ADD_TEST(pack1);
-
-	ADD_TEST(rename0);
-	ADD_TEST(rename1);
-	ADD_TEST(rename2);
-	ADD_TEST(rename3);
-	ADD_TEST(rename4);
-	ADD_TEST(rename5);
-	ADD_TEST(rename6);
-	ADD_TEST(rename7);
-	ADD_TEST(rename8);
-
-	ADD_TEST(delete0);
-
-	ADD_TEST(list0);
-	ADD_TEST(list1);
-
-	ADD_TEST(reflog0);
-	ADD_TEST(reflog1);
-END_SUITE
diff --git a/tests/t12-repo.c b/tests/t12-repo.c
deleted file mode 100644
index cc8942f..0000000
--- a/tests/t12-repo.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include "odb.h"
-#include "git2/odb_backend.h"
-#include "repository.h"
-
-typedef struct {
-	git_odb_backend base;
-	int position;
-} fake_backend;
-
-git_odb_backend *new_backend(int position)
-{
-	fake_backend *b;
-
-	b = git__malloc(sizeof(fake_backend));
-	if (b == NULL)
-		return NULL;
-
-	memset(b, 0x0, sizeof(fake_backend));
-	b->position = position;
-	return (git_odb_backend *)b;
-}
-
-int test_backend_sorting(git_odb *odb)
-{
-	unsigned int i;
-
-	for (i = 0; i < odb->backends.length; ++i) {
-		fake_backend *internal = *((fake_backend **)git_vector_get(&odb->backends, i));
-
-		if (internal == NULL)
-			return GIT_ERROR;
-
-		if (internal->position != (int)i)
-			return GIT_ERROR;
-	}
-
-	return GIT_SUCCESS;
-}
-
-BEGIN_TEST(odb0, "assure that ODB backends are properly sorted")
-	git_odb *odb;
-	must_pass(git_odb_new(&odb));
-	must_pass(git_odb_add_backend(odb, new_backend(0), 5));
-	must_pass(git_odb_add_backend(odb, new_backend(2), 3));
-	must_pass(git_odb_add_backend(odb, new_backend(1), 4));
-	must_pass(git_odb_add_backend(odb, new_backend(3), 1));
-	must_pass(test_backend_sorting(odb));
-	git_odb_close(odb);
-END_TEST
-
-BEGIN_TEST(odb1, "assure that alternate backends are properly sorted")
-	git_odb *odb;
-	must_pass(git_odb_new(&odb));
-	must_pass(git_odb_add_backend(odb, new_backend(0), 5));
-	must_pass(git_odb_add_backend(odb, new_backend(2), 3));
-	must_pass(git_odb_add_backend(odb, new_backend(1), 4));
-	must_pass(git_odb_add_backend(odb, new_backend(3), 1));
-	must_pass(git_odb_add_alternate(odb, new_backend(4), 5));
-	must_pass(git_odb_add_alternate(odb, new_backend(6), 3));
-	must_pass(git_odb_add_alternate(odb, new_backend(5), 4));
-	must_pass(git_odb_add_alternate(odb, new_backend(7), 1));
-	must_pass(test_backend_sorting(odb));
-	git_odb_close(odb);
-END_TEST
-
-
-#define STANDARD_REPOSITORY 0
-#define BARE_REPOSITORY 1
-
-static int ensure_repository_init(
-	const char *working_directory,
-	int repository_kind,
-	const char *expected_path_index,
-	const char *expected_path_repository,
-	const char *expected_working_directory)
-{
-	char path_odb[GIT_PATH_MAX];
-	git_repository *repo;
-
-	if (git_futils_isdir(working_directory) == GIT_SUCCESS)
-		return GIT_ERROR;
-
-	git_path_join(path_odb, expected_path_repository, GIT_OBJECTS_DIR);
-
-	if (git_repository_init(&repo, working_directory, repository_kind) < GIT_SUCCESS)
-		return GIT_ERROR;
-
-	if (repo->path_workdir != NULL || expected_working_directory != NULL) {
-		if (git__suffixcmp(repo->path_workdir, expected_working_directory) != 0)
-			goto cleanup;
-	}
-
-	if (git__suffixcmp(repo->path_odb, path_odb) != 0)
-		goto cleanup;
-
-	if (git__suffixcmp(repo->path_repository, expected_path_repository) != 0)
-		goto cleanup;
-
-	if (repo->path_index != NULL || expected_path_index != NULL) {
-		if (git__suffixcmp(repo->path_index, expected_path_index) != 0)
-			goto cleanup;
-
-#ifdef GIT_WIN32
-		if ((GetFileAttributes(repo->path_repository) & FILE_ATTRIBUTE_HIDDEN) == 0)
-			goto cleanup;
-#endif
-
-		if (git_repository_is_bare(repo) == 1)
-			goto cleanup;
-	} else if (git_repository_is_bare(repo) == 0)
-			goto cleanup;
-
-	if (git_repository_is_empty(repo) == 0)
-		goto cleanup;
-
-	git_repository_free(repo);
-	git_futils_rmdir_r(working_directory, 1);
-
-	return GIT_SUCCESS;
-
-cleanup:
-	git_repository_free(repo);
-	git_futils_rmdir_r(working_directory, 1);
-	return GIT_ERROR;
-}
-
-BEGIN_TEST(init0, "initialize a standard repo")
-	char path_index[GIT_PATH_MAX], path_repository[GIT_PATH_MAX];
-
-	git_path_join(path_repository, TEMP_REPO_FOLDER, GIT_DIR);
-	git_path_join(path_index, path_repository, GIT_INDEX_FILE);
-
-	must_pass(ensure_repository_init(TEMP_REPO_FOLDER, STANDARD_REPOSITORY, path_index, path_repository, TEMP_REPO_FOLDER));
-	must_pass(ensure_repository_init(TEMP_REPO_FOLDER_NS, STANDARD_REPOSITORY, path_index, path_repository, TEMP_REPO_FOLDER));
-END_TEST
-
-BEGIN_TEST(init1, "initialize a bare repo")
-	char path_repository[GIT_PATH_MAX];
-
-	git_path_join(path_repository, TEMP_REPO_FOLDER, "");
-
-	must_pass(ensure_repository_init(TEMP_REPO_FOLDER, BARE_REPOSITORY, NULL, path_repository, NULL));
-	must_pass(ensure_repository_init(TEMP_REPO_FOLDER_NS, BARE_REPOSITORY, NULL, path_repository, NULL));
-END_TEST
-
-BEGIN_TEST(init2, "Initialize and open a bare repo with a relative path escaping out of the current working directory")
-	char path_repository[GIT_PATH_MAX];
-	char current_workdir[GIT_PATH_MAX];
-	const int mode = 0755; /* or 0777 ? */
-	git_repository* repo;
-
-	must_pass(p_getcwd(current_workdir, sizeof(current_workdir)));
-
-	git_path_join(path_repository, TEMP_REPO_FOLDER, "a/b/c/");
-	must_pass(git_futils_mkdir_r(path_repository, mode));
-
-	must_pass(chdir(path_repository));
-
-	must_pass(git_repository_init(&repo, "../d/e.git", 1));
-	must_pass(git__suffixcmp(repo->path_repository, "/a/b/d/e.git/"));
-
-	git_repository_free(repo);
-
-	must_pass(git_repository_open(&repo, "../d/e.git"));
-
-	git_repository_free(repo);
-
-	must_pass(chdir(current_workdir));
-	must_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, 1));
-END_TEST
-
-#define EMPTY_BARE_REPOSITORY_FOLDER TEST_RESOURCES "/empty_bare.git/"
-
-BEGIN_TEST(open0, "Open a bare repository that has just been initialized by git")
-	git_repository *repo;
-
-	must_pass(copydir_recurs(EMPTY_BARE_REPOSITORY_FOLDER, TEMP_REPO_FOLDER));
-	must_pass(remove_placeholders(TEMP_REPO_FOLDER, "dummy-marker.txt"));
-
-	must_pass(git_repository_open(&repo, TEMP_REPO_FOLDER));
-	must_be_true(git_repository_path(repo, GIT_REPO_PATH) != NULL);
-	must_be_true(git_repository_path(repo, GIT_REPO_PATH_WORKDIR) == NULL);
-
-	git_repository_free(repo);
-	must_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, 1));
-END_TEST
-
-#define EMPTY_REPOSITORY_FOLDER TEST_RESOURCES "/empty_standard_repo/.gitted/"
-
-BEGIN_TEST(open1, "Open a standard repository that has just been initialized by git")
-	git_repository *repo;
-
-	must_pass(copydir_recurs(EMPTY_REPOSITORY_FOLDER, TEST_STD_REPO_FOLDER));
-	must_pass(remove_placeholders(TEST_STD_REPO_FOLDER, "dummy-marker.txt"));
-
-	must_pass(git_repository_open(&repo, TEST_STD_REPO_FOLDER));
-	must_be_true(git_repository_path(repo, GIT_REPO_PATH) != NULL);
-	must_be_true(git_repository_path(repo, GIT_REPO_PATH_WORKDIR) != NULL);
-
-	git_repository_free(repo);
-	must_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, 1));
-END_TEST
-
-
-BEGIN_TEST(open2, "Open a bare repository with a relative path escaping out of the current working directory")
-	char new_current_workdir[GIT_PATH_MAX];
-	char current_workdir[GIT_PATH_MAX];
-	char path_repository[GIT_PATH_MAX];
-
-	const int mode = 0755; /* or 0777 ? */
-	git_repository* repo;
-
-	/* Setup the repository to open */
-	must_pass(p_getcwd(current_workdir, sizeof(current_workdir)));
-	strcpy(path_repository, current_workdir);
-	git_path_join_n(path_repository, 3, path_repository, TEMP_REPO_FOLDER, "a/d/e.git");
-	must_pass(copydir_recurs(REPOSITORY_FOLDER, path_repository));
-
-	/* Change the current working directory */
-	git_path_join(new_current_workdir, TEMP_REPO_FOLDER, "a/b/c/");
-	must_pass(git_futils_mkdir_r(new_current_workdir, mode));
-	must_pass(chdir(new_current_workdir));
-
-	must_pass(git_repository_open(&repo, "../../d/e.git"));
-
-	git_repository_free(repo);
-
-	must_pass(chdir(current_workdir));
-	must_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, 1));
-END_TEST
-
-BEGIN_TEST(empty0, "test if a repository is empty or not")
-
-	git_repository *repo_empty, *repo_normal;
-
-	must_pass(git_repository_open(&repo_normal, REPOSITORY_FOLDER));
-	must_be_true(git_repository_is_empty(repo_normal) == 0);
-	git_repository_free(repo_normal);
-
-	must_pass(git_repository_open(&repo_empty, EMPTY_BARE_REPOSITORY_FOLDER));
-	must_be_true(git_repository_is_empty(repo_empty) == 1);
-	git_repository_free(repo_empty);
-END_TEST
-
-BEGIN_TEST(detached0, "test if HEAD is detached")
-	git_repository *repo;
-	git_reference *ref;
-	git_oid oid;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_be_true(git_repository_head_detached(repo) == 0);
-
-	/* detach the HEAD */
-	git_oid_fromstr(&oid, "c47800c7266a2be04c571c04d5a6614691ea99bd");
-	must_pass(git_reference_create_oid(&ref, repo, "HEAD", &oid, 1));
-	must_be_true(git_repository_head_detached(repo) == 1);
-
-	/* take the reop back to it's original state */
-	must_pass(git_reference_create_symbolic(&ref, repo, "HEAD", "refs/heads/master", 1));
-	must_be_true(git_repository_head_detached(repo) == 0);
-
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(orphan0, "test if HEAD is orphan")
-	git_repository *repo;
-	git_reference *ref;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
-	must_be_true(git_repository_head_orphan(repo) == 0);
-
-	/* orphan HEAD */
-	must_pass(git_reference_create_symbolic(&ref, repo, "HEAD", "refs/heads/orphan", 1));
-	must_be_true(git_repository_head_orphan(repo) == 1);
-
-	/* take the reop back to it's original state */
-	must_pass(git_reference_create_symbolic(&ref, repo, "HEAD", "refs/heads/master", 1));
-	must_be_true(git_repository_head_orphan(repo) == 0);
-
-	git_repository_free(repo);
-END_TEST
-
-#define DISCOVER_FOLDER TEMP_REPO_FOLDER "discover.git"
-
-#define SUB_REPOSITORY_FOLDER_NAME "sub_repo"
-#define SUB_REPOSITORY_FOLDER DISCOVER_FOLDER "/" SUB_REPOSITORY_FOLDER_NAME
-#define SUB_REPOSITORY_FOLDER_SUB SUB_REPOSITORY_FOLDER "/sub"
-#define SUB_REPOSITORY_FOLDER_SUB_SUB SUB_REPOSITORY_FOLDER_SUB "/subsub"
-#define SUB_REPOSITORY_FOLDER_SUB_SUB_SUB SUB_REPOSITORY_FOLDER_SUB_SUB "/subsubsub"
-
-#define REPOSITORY_ALTERNATE_FOLDER DISCOVER_FOLDER "/alternate_sub_repo"
-#define REPOSITORY_ALTERNATE_FOLDER_SUB REPOSITORY_ALTERNATE_FOLDER "/sub"
-#define REPOSITORY_ALTERNATE_FOLDER_SUB_SUB REPOSITORY_ALTERNATE_FOLDER_SUB "/subsub"
-#define REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB REPOSITORY_ALTERNATE_FOLDER_SUB_SUB "/subsubsub"
-
-#define ALTERNATE_MALFORMED_FOLDER1 DISCOVER_FOLDER "/alternate_malformed_repo1"
-#define ALTERNATE_MALFORMED_FOLDER2 DISCOVER_FOLDER "/alternate_malformed_repo2"
-#define ALTERNATE_MALFORMED_FOLDER3 DISCOVER_FOLDER "/alternate_malformed_repo3"
-#define ALTERNATE_NOT_FOUND_FOLDER DISCOVER_FOLDER "/alternate_not_found_repo"
-
-static int ensure_repository_discover(const char *start_path, const char *ceiling_dirs, const char *expected_path)
-{
-	int error;
-	char found_path[GIT_PATH_MAX];
-
-	error = git_repository_discover(found_path, sizeof(found_path), start_path, 0, ceiling_dirs);
-	//across_fs is always 0 as we can't automate the filesystem change tests
-
-	if (error < GIT_SUCCESS)
-		return error;
-
-	return strcmp(found_path, expected_path) ? GIT_ERROR : GIT_SUCCESS;
-}
-
-static int write_file(const char *path, const char *content)
-{
-	int error;
-	git_file file;
-
-	if (git_futils_exists(path) == GIT_SUCCESS) {
-		error = p_unlink(path);
-
-		if (error < GIT_SUCCESS)
-			return error;
-	}
-
-	file = git_futils_creat_withpath(path, 0644);
-	if (file < GIT_SUCCESS)
-		return file;
-
-	error = p_write(file, content, strlen(content) * sizeof(char));
-
-	p_close(file);
-
-	return error;
-}
-
-//no check is performed on ceiling_dirs length, so be sure it's long enough
-static int append_ceiling_dir(char *ceiling_dirs, const char *path)
-{
-	int len = strlen(ceiling_dirs);
-	int error;
-
-	error = git_path_prettify_dir(ceiling_dirs + len + (len ? 1 : 0), path, NULL);
-	if (error < GIT_SUCCESS)
-		return git__rethrow(error, "Failed to append ceiling directory.");
-
-	if (len)
-		ceiling_dirs[len] = GIT_PATH_LIST_SEPARATOR;
-
-	return GIT_SUCCESS;
-}
-
-BEGIN_TEST(discover0, "test discover")
-	git_repository *repo;
-	char ceiling_dirs[GIT_PATH_MAX * 2] = "";
-	char repository_path[GIT_PATH_MAX];
-	char sub_repository_path[GIT_PATH_MAX];
-	char found_path[GIT_PATH_MAX];
-	int mode = 0755;
-
-	git_futils_mkdir_r(DISCOVER_FOLDER, mode);
-	must_pass(append_ceiling_dir(ceiling_dirs, TEMP_REPO_FOLDER));
-
-	must_be_true(git_repository_discover(repository_path, sizeof(repository_path), DISCOVER_FOLDER, 0, ceiling_dirs) == GIT_ENOTAREPO);
-
-	must_pass(git_repository_init(&repo, DISCOVER_FOLDER, 1));
-	must_pass(git_repository_discover(repository_path, sizeof(repository_path), DISCOVER_FOLDER, 0, ceiling_dirs));
-	git_repository_free(repo);
-
-	must_pass(git_repository_init(&repo, SUB_REPOSITORY_FOLDER, 0));
-	must_pass(git_futils_mkdir_r(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, mode));
-	must_pass(git_repository_discover(sub_repository_path, sizeof(sub_repository_path), SUB_REPOSITORY_FOLDER, 0, ceiling_dirs));
-
-	must_pass(git_futils_mkdir_r(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, mode));
-	must_pass(ensure_repository_discover(SUB_REPOSITORY_FOLDER_SUB, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(SUB_REPOSITORY_FOLDER_SUB_SUB, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, ceiling_dirs, sub_repository_path));
-
-	must_pass(git_futils_mkdir_r(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB, mode));
-	must_pass(write_file(REPOSITORY_ALTERNATE_FOLDER "/" DOT_GIT, "gitdir: ../" SUB_REPOSITORY_FOLDER_NAME "/" DOT_GIT));
-	must_pass(write_file(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB "/" DOT_GIT, "gitdir: ../../../" SUB_REPOSITORY_FOLDER_NAME "/" DOT_GIT));
-	must_pass(write_file(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB "/" DOT_GIT, "gitdir: ../../../../"));
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB, ceiling_dirs, repository_path));
-
-	must_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER1, mode));
-	must_pass(write_file(ALTERNATE_MALFORMED_FOLDER1 "/" DOT_GIT, "Anything but not gitdir:"));
-	must_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER2, mode));
-	must_pass(write_file(ALTERNATE_MALFORMED_FOLDER2 "/" DOT_GIT, "gitdir:"));
-	must_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER3, mode));
-	must_pass(write_file(ALTERNATE_MALFORMED_FOLDER3 "/" DOT_GIT, "gitdir: \n\n\n"));
-	must_pass(git_futils_mkdir_r(ALTERNATE_NOT_FOUND_FOLDER, mode));
-	must_pass(write_file(ALTERNATE_NOT_FOUND_FOLDER "/" DOT_GIT, "gitdir: a_repository_that_surely_does_not_exist"));
-	must_fail(git_repository_discover(found_path, sizeof(found_path), ALTERNATE_MALFORMED_FOLDER1, 0, ceiling_dirs));
-	must_fail(git_repository_discover(found_path, sizeof(found_path), ALTERNATE_MALFORMED_FOLDER2, 0, ceiling_dirs));
-	must_fail(git_repository_discover(found_path, sizeof(found_path), ALTERNATE_MALFORMED_FOLDER3, 0, ceiling_dirs));
-	must_fail(git_repository_discover(found_path, sizeof(found_path), ALTERNATE_NOT_FOUND_FOLDER, 0, ceiling_dirs));
-
-	must_pass(append_ceiling_dir(ceiling_dirs, SUB_REPOSITORY_FOLDER));
-	//this must pass as ceiling_directories cannot predent the current
-	//working directory to be checked
-	must_pass(git_repository_discover(found_path, sizeof(found_path), SUB_REPOSITORY_FOLDER, 0, ceiling_dirs));
-	must_fail(git_repository_discover(found_path, sizeof(found_path), SUB_REPOSITORY_FOLDER_SUB, 0, ceiling_dirs));
-	must_fail(git_repository_discover(found_path, sizeof(found_path), SUB_REPOSITORY_FOLDER_SUB_SUB, 0, ceiling_dirs));
-	must_fail(git_repository_discover(found_path, sizeof(found_path), SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, 0, ceiling_dirs));
-
-	//.gitfile redirection should not be affected by ceiling directories
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB, ceiling_dirs, sub_repository_path));
-	must_pass(ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB, ceiling_dirs, repository_path));
-
-	must_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, 1));
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_SUITE(repository)
-	ADD_TEST(odb0);
-	ADD_TEST(odb1);
-	ADD_TEST(init0);
-	ADD_TEST(init1);
-	ADD_TEST(init2);
-	ADD_TEST(open0);
-	ADD_TEST(open1);
-	ADD_TEST(open2);
-	ADD_TEST(empty0);
-	ADD_TEST(detached0);
-	ADD_TEST(orphan0);
-	ADD_TEST(discover0);
-END_SUITE
-
diff --git a/tests/t13-threads.c b/tests/t13-threads.c
deleted file mode 100644
index 3888b70..0000000
--- a/tests/t13-threads.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-#include "cache.h"
-
-
-typedef struct {
-	git_cached_obj cached;
-	unsigned int __dummy;
-} ttest_obj;
-
-BEGIN_TEST(cache0, "run several threads polling the cache at the same time")
-
-END_TEST
-
-BEGIN_SUITE(threads)
-	ADD_TEST(cache0);
-END_SUITE
diff --git a/tests/t15-config.c b/tests/t15-config.c
deleted file mode 100644
index 05de25f..0000000
--- a/tests/t15-config.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include <git2.h>
-#include "filebuf.h"
-
-#define CONFIG_BASE TEST_RESOURCES "/config"
-
-/*
- * This one is so we know the code isn't completely broken
- */
-BEGIN_TEST(config0, "read a simple configuration")
-	git_config *cfg;
-	int i;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config0"));
-	must_pass(git_config_get_int(cfg, "core.repositoryformatversion", &i));
-	must_be_true(i == 0);
-	must_pass(git_config_get_bool(cfg, "core.filemode", &i));
-	must_be_true(i == 1);
-	must_pass(git_config_get_bool(cfg, "core.bare", &i));
-	must_be_true(i == 0);
-	must_pass(git_config_get_bool(cfg, "core.logallrefupdates", &i));
-	must_be_true(i == 1);
-
-	git_config_free(cfg);
-END_TEST
-
-/*
- * [this "that"] and [this "That] are different namespaces. Make sure
- * each returns the correct one.
- */
-BEGIN_TEST(config1, "case sensitivity")
-	git_config *cfg;
-	int i;
-	const char *str;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config1"));
-
-	must_pass(git_config_get_string(cfg, "this.that.other", &str));
-	must_be_true(!strcmp(str, "true"));
-	must_pass(git_config_get_string(cfg, "this.That.other", &str));
-	must_be_true(!strcmp(str, "yes"));
-
-	must_pass(git_config_get_bool(cfg, "this.that.other", &i));
-	must_be_true(i == 1);
-	must_pass(git_config_get_bool(cfg, "this.That.other", &i));
-	must_be_true(i == 1);
-
-	/* This one doesn't exist */
-	must_fail(git_config_get_bool(cfg, "this.thaT.other", &i));
-
-	git_config_free(cfg);
-END_TEST
-
-/*
- * If \ is the last non-space character on the line, we read the next
- * one, separating each line with SP.
- */
-BEGIN_TEST(config2, "parse a multiline value")
-	git_config *cfg;
-	const char *str;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config2"));
-
-	must_pass(git_config_get_string(cfg, "this.That.and", &str));
-	must_be_true(!strcmp(str, "one one one two two three three"));
-
-	git_config_free(cfg);
-END_TEST
-
-/*
- * This kind of subsection declaration is case-insensitive
- */
-BEGIN_TEST(config3, "parse a [section.subsection] header")
-	git_config *cfg;
-	const char *str;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config3"));
-
-	must_pass(git_config_get_string(cfg, "section.subsection.var", &str));
-	must_be_true(!strcmp(str, "hello"));
-
-	/* Avoid a false positive */
-	str = "nohello";
-	must_pass(git_config_get_string(cfg, "section.subSectIon.var", &str));
-	must_be_true(!strcmp(str, "hello"));
-
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config4, "a variable name on its own is valid")
-	git_config *cfg;
-const char *str;
-int i;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config4"));
-
-	must_pass(git_config_get_string(cfg, "some.section.variable", &str));
-	must_be_true(str == NULL);
-
-	must_pass(git_config_get_bool(cfg, "some.section.variable", &i));
-	must_be_true(i == 1);
-
-
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config5, "test number suffixes")
-	git_config *cfg;
-	long int i;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config5"));
-
-	must_pass(git_config_get_long(cfg, "number.simple", &i));
-	must_be_true(i == 1);
-
-	must_pass(git_config_get_long(cfg, "number.k", &i));
-	must_be_true(i == 1 * 1024);
-
-	must_pass(git_config_get_long(cfg, "number.kk", &i));
-	must_be_true(i == 1 * 1024);
-
-	must_pass(git_config_get_long(cfg, "number.m", &i));
-	must_be_true(i == 1 * 1024 * 1024);
-
-	must_pass(git_config_get_long(cfg, "number.mm", &i));
-	must_be_true(i == 1 * 1024 * 1024);
-
-	must_pass(git_config_get_long(cfg, "number.g", &i));
-	must_be_true(i == 1 * 1024 * 1024 * 1024);
-
-	must_pass(git_config_get_long(cfg, "number.gg", &i));
-	must_be_true(i == 1 * 1024 * 1024 * 1024);
-
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config6, "test blank lines")
-	git_config *cfg;
-	int i;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config6"));
-
-	must_pass(git_config_get_bool(cfg, "valid.subsection.something", &i));
-	must_be_true(i == 1);
-
-	must_pass(git_config_get_bool(cfg, "something.else.something", &i));
-	must_be_true(i == 0);
-
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config7, "test for invalid ext headers")
-	git_config *cfg;
-
-	must_fail(git_config_open_ondisk(&cfg, CONFIG_BASE "/config7"));
-
-END_TEST
-
-BEGIN_TEST(config8, "don't fail on empty files")
-	git_config *cfg;
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config8"));
-
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config9, "replace a value")
-	git_config *cfg;
-	int i;
-
-	/* By freeing the config, we make sure we flush the values  */
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config9"));
-	must_pass(git_config_set_int(cfg, "core.dummy", 5));
-	git_config_free(cfg);
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config9"));
-	must_pass(git_config_get_int(cfg, "core.dummy", &i));
-	must_be_true(i == 5);
-	git_config_free(cfg);
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config9"));
-	must_pass(git_config_set_int(cfg, "core.dummy", 1));
-	git_config_free(cfg);
-
-END_TEST
-
-BEGIN_TEST(config10, "a repo's config overrides the global config")
-	git_repository *repo;
-	git_config *cfg;
-	int version;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_repository_config(&cfg, repo, CONFIG_BASE "/.gitconfig", NULL));
-	must_pass(git_config_get_int(cfg, "core.repositoryformatversion", &version));
-	must_be_true(version == 0);
-	git_config_free(cfg);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(config11, "fall back to the global config")
-	git_repository *repo;
-	git_config *cfg;
-	int num;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_repository_config(&cfg, repo, CONFIG_BASE "/.gitconfig", NULL));
-	must_pass(git_config_get_int(cfg, "core.something", &num));
-	must_be_true(num == 2);
-	git_config_free(cfg);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(config12, "delete a value")
-	git_config *cfg;
-	int i;
-
-	/* By freeing the config, we make sure we flush the values  */
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config9"));
-	must_pass(git_config_set_int(cfg, "core.dummy", 5));
-	git_config_free(cfg);
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config9"));
-	must_pass(git_config_delete(cfg, "core.dummy"));
-	git_config_free(cfg);
-
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config9"));
-	must_be_true(git_config_get_int(cfg, "core.dummy", &i) == GIT_ENOTFOUND);
-	must_pass(git_config_set_int(cfg, "core.dummy", 1));
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config13, "can't delete a non-existent value")
-	git_config *cfg;
-
-	/* By freeing the config, we make sure we flush the values  */
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config9"));
-	must_be_true(git_config_delete(cfg, "core.imaginary") == GIT_ENOTFOUND);
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config14, "don't fail horribly if a section header is in the last line")
-	git_config *cfg;
-
-	/* By freeing the config, we make sure we flush the values  */
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config10"));
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config15, "add a variable in an existing section")
-	git_config *cfg;
-	int i;
-
-	/* By freeing the config, we make sure we flush the values  */
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config10"));
-	must_pass(git_config_set_int(cfg, "empty.tmp", 5));
-	must_pass(git_config_get_int(cfg, "empty.tmp", &i));
-	must_be_true(i == 5);
-	must_pass(git_config_delete(cfg, "empty.tmp"));
-	git_config_free(cfg);
-END_TEST
-
-BEGIN_TEST(config16, "add a variable in a new section")
-	git_config *cfg;
-	int i;
-	git_filebuf buf;
-
-	/* By freeing the config, we make sure we flush the values  */
-	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config10"));
-	must_pass(git_config_set_int(cfg, "section.tmp", 5));
-	must_pass(git_config_get_int(cfg, "section.tmp", &i));
-	must_be_true(i == 5);
-	must_pass(git_config_delete(cfg, "section.tmp"));
-	git_config_free(cfg);
-
-	/* As the section wasn't removed, owerwrite the file */
-	must_pass(git_filebuf_open(&buf, CONFIG_BASE "/config10", 0));
-	must_pass(git_filebuf_write(&buf, "[empty]\n", strlen("[empty]\n")));
-	must_pass(git_filebuf_commit(&buf));
-END_TEST
-
-BEGIN_SUITE(config)
-	 ADD_TEST(config0);
-	 ADD_TEST(config1);
-	 ADD_TEST(config2);
-	 ADD_TEST(config3);
-	 ADD_TEST(config4);
-	 ADD_TEST(config5);
-	 ADD_TEST(config6);
-	 ADD_TEST(config7);
-	 ADD_TEST(config8);
-	 ADD_TEST(config9);
-	 ADD_TEST(config10);
-	 ADD_TEST(config11);
-	 ADD_TEST(config12);
-	 ADD_TEST(config13);
-	 ADD_TEST(config14);
-	 ADD_TEST(config15);
-	 ADD_TEST(config16);
-END_SUITE
diff --git a/tests/t16-remotes.c b/tests/t16-remotes.c
deleted file mode 100644
index 4bc2f55..0000000
--- a/tests/t16-remotes.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include <git2.h>
-
-BEGIN_TEST(remotes0, "remote parsing works")
-	git_remote *remote;
-	git_repository *repo;
-	git_config *cfg;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_repository_config(&cfg, repo, NULL, NULL));
-	must_pass(git_remote_get(&remote, cfg, "test"));
-	must_be_true(!strcmp(git_remote_name(remote), "test"));
-	must_be_true(!strcmp(git_remote_url(remote), "git://github.com/libgit2/libgit2"));
-
-	git_remote_free(remote);
-	git_config_free(cfg);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(refspec0, "remote with refspec works")
-	git_remote *remote;
-	git_repository *repo;
-	git_config *cfg;
-	const git_refspec *refspec = NULL;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_repository_config(&cfg, repo, NULL, NULL));
-	must_pass(git_remote_get(&remote, cfg, "test"));
-	refspec = git_remote_fetchspec(remote);
-	must_be_true(refspec != NULL);
-	must_be_true(!strcmp(git_refspec_src(refspec), "refs/heads/*"));
-	must_be_true(!strcmp(git_refspec_dst(refspec), "refs/remotes/test/*"));
-	git_remote_free(remote);
-	git_config_free(cfg);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(refspec1, "remote fnmatch works as expected")
-	git_remote *remote;
-	git_repository *repo;
-	git_config *cfg;
-	const git_refspec *refspec = NULL;
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_repository_config(&cfg, repo, NULL, NULL));
-	must_pass(git_remote_get(&remote, cfg, "test"));
-	refspec = git_remote_fetchspec(remote);
-	must_be_true(refspec != NULL);
-	must_pass(git_refspec_src_match(refspec, "refs/heads/master"));
-	must_pass(git_refspec_src_match(refspec, "refs/heads/multi/level/branch"));
-	git_remote_free(remote);
-	git_config_free(cfg);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(refspec2, "refspec transform")
-	git_remote *remote;
-	git_repository *repo;
-	git_config *cfg;
-	const git_refspec *refspec = NULL;
-	char ref[1024] = {0};
-
-	must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-	must_pass(git_repository_config(&cfg, repo, NULL, NULL));
-	must_pass(git_remote_get(&remote, cfg, "test"));
-	refspec = git_remote_fetchspec(remote);
-	must_be_true(refspec != NULL);
-	must_pass(git_refspec_transform(ref, sizeof(ref), refspec, "refs/heads/master"));
-	must_be_true(!strcmp(ref, "refs/remotes/test/master"));
-	git_remote_free(remote);
-	git_config_free(cfg);
-	git_repository_free(repo);
-END_TEST
-
-BEGIN_SUITE(remotes)
-	 ADD_TEST(remotes0)
-	 ADD_TEST(refspec0)
-	 ADD_TEST(refspec1)
-	 ADD_TEST(refspec2)
-END_SUITE
diff --git a/tests/t17-bufs.c b/tests/t17-bufs.c
deleted file mode 100644
index 2cbd8c8..0000000
--- a/tests/t17-bufs.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "test_lib.h"
-#include "test_helpers.h"
-
-#include <git2.h>
-#include "buffer.h"
-
-const char *test_string = "Have you seen that? Have you seeeen that??";
-
-BEGIN_TEST(buf0, "check that resizing works properly")
-	git_buf buf = GIT_BUF_INIT;
-	git_buf_puts(&buf, test_string);
-
-	must_be_true(git_buf_oom(&buf) == 0);
-	must_be_true(strcmp(git_buf_cstr(&buf), test_string) == 0);
-
-	git_buf_puts(&buf, test_string);
-	must_be_true(strlen(git_buf_cstr(&buf)) == strlen(test_string) * 2);
-	git_buf_free(&buf);
-END_TEST
-
-BEGIN_TEST(buf1, "check that printf works properly")
-	git_buf buf = GIT_BUF_INIT;
-
-	git_buf_printf(&buf, "%s %s %d ", "shoop", "da", 23);
-	must_be_true(git_buf_oom(&buf) == 0);
-	must_be_true(strcmp(git_buf_cstr(&buf), "shoop da 23 ") == 0);
-
-	git_buf_printf(&buf, "%s %d", "woop", 42);
-	must_be_true(git_buf_oom(&buf) == 0);
-	must_be_true(strcmp(git_buf_cstr(&buf), "shoop da 23 woop 42") == 0);
-	git_buf_free(&buf);
-END_TEST
-
-BEGIN_SUITE(buffers)
-	 ADD_TEST(buf0)
-	 ADD_TEST(buf1)
-END_SUITE
diff --git a/tests/t18-status.c b/tests/t18-status.c
deleted file mode 100644
index c30c541..0000000
--- a/tests/t18-status.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "test_lib.h"
-#include "test_helpers.h"
-#include "fileops.h"
-#include "git2/status.h"
-
-static const char *test_blob_oid = "d4fa8600b4f37d7516bef4816ae2c64dbf029e3a";
-
-#define STATUS_WORKDIR_FOLDER TEST_RESOURCES "/status/"
-#define STATUS_REPOSITORY_TEMP_FOLDER TEMP_REPO_FOLDER ".gitted/"
-
-BEGIN_TEST(file0, "test retrieving OID from a file apart from the ODB")
-	git_oid expected_id, actual_id;
-	char filename[] = "new_file";
-	int fd;
-
-	fd = p_creat(filename, 0644);
-	must_pass(fd);
-	must_pass(p_write(fd, "new_file\n", 9));
-	must_pass(p_close(fd));
-
-	must_pass(git_odb_hashfile(&actual_id, filename, GIT_OBJ_BLOB));
-
-	must_pass(git_oid_fromstr(&expected_id, test_blob_oid));
-	must_be_true(git_oid_cmp(&expected_id, &actual_id) == 0);
-
-	must_pass(p_unlink(filename));
-END_TEST
-
-static const char *entry_paths[] = {
-	"current_file",
-	"file_deleted",
-	"modified_file",
-	"new_file",
-	"staged_changes",
-	"staged_changes_file_deleted",
-	"staged_changes_modified_file",
-	"staged_delete_file_deleted",
-	"staged_delete_modified_file",
-	"staged_new_file",
-	"staged_new_file_deleted_file",
-	"staged_new_file_modified_file",
-
-	"subdir/current_file",
-	"subdir/deleted_file",
-	"subdir/modified_file",
-	"subdir/new_file",
-};
-static const unsigned int entry_statuses[] = {
-	GIT_STATUS_CURRENT,
-	GIT_STATUS_WT_DELETED,
-	GIT_STATUS_WT_MODIFIED,
-	GIT_STATUS_WT_NEW,
-	GIT_STATUS_INDEX_MODIFIED,
-	GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_DELETED,
-	GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED,
-	GIT_STATUS_INDEX_DELETED,
-	GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_NEW,
-	GIT_STATUS_INDEX_NEW,
-	GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_DELETED,
-	GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_MODIFIED,
-
-	GIT_STATUS_CURRENT,
-	GIT_STATUS_WT_DELETED,
-	GIT_STATUS_WT_MODIFIED,
-	GIT_STATUS_WT_NEW,
-};
-#define ENTRY_COUNT 16
-
-static unsigned int get_expected_entry_status(const char *path)
-{
-	int i;
-
-	for (i = 0; i < ENTRY_COUNT; ++i)
-		if (!strcmp(path, entry_paths[i]))
-			return entry_statuses[i];
-
-	return (unsigned int)-1;
-}
-
-struct status_entry_counts {
-	int wrong_status_flags_count;
-	int entry_count;
-};
-
-static int status_cb(const char *path, unsigned int status_flags, void *payload)
-{
-	unsigned int expected_status_flags = get_expected_entry_status(path);
-	struct status_entry_counts *counts = (struct status_entry_counts *)payload;
-
-	counts->entry_count++;
-	if (status_flags != expected_status_flags)
-		counts->wrong_status_flags_count++;
-
-	return GIT_SUCCESS;
-}
-
-BEGIN_TEST(statuscb0, "test retrieving status for worktree of repository")
-	git_repository *repo;
-	struct status_entry_counts counts;
-
-	must_pass(copydir_recurs(STATUS_WORKDIR_FOLDER, TEMP_REPO_FOLDER));
-	must_pass(git_futils_mv_atomic(STATUS_REPOSITORY_TEMP_FOLDER, TEST_STD_REPO_FOLDER));
-	must_pass(git_repository_open(&repo, TEST_STD_REPO_FOLDER));
-
-	memset(&counts, 0x0, sizeof(struct status_entry_counts));
-	git_status_foreach(repo, status_cb, &counts);
-	must_be_true(counts.entry_count == ENTRY_COUNT);
-	must_be_true(counts.wrong_status_flags_count == 0);
-
-	git_repository_free(repo);
-
-	git_futils_rmdir_r(TEMP_REPO_FOLDER, 1);
-END_TEST
-
-BEGIN_TEST(singlestatus0, "test retrieving status for single file")
-	git_repository *repo;
-	unsigned int status_flags;
-	int i;
-
-	must_pass(copydir_recurs(STATUS_WORKDIR_FOLDER, TEMP_REPO_FOLDER));
-	must_pass(git_futils_mv_atomic(STATUS_REPOSITORY_TEMP_FOLDER, TEST_STD_REPO_FOLDER));
-	must_pass(git_repository_open(&repo, TEST_STD_REPO_FOLDER));
-
-	for (i = 0; i < ENTRY_COUNT; ++i) {
-		must_pass(git_status_file(&status_flags, repo, entry_paths[i]));
-		must_be_true(status_flags == entry_statuses[i]);
-	}
-
-	git_repository_free(repo);
-
-	git_futils_rmdir_r(TEMP_REPO_FOLDER, 1);
-END_TEST
-
-BEGIN_TEST(singlestatus1, "test retrieving status for nonexistent file")
-	git_repository *repo;
-	unsigned int status_flags;
-	int error;
-
-	must_pass(copydir_recurs(STATUS_WORKDIR_FOLDER, TEMP_REPO_FOLDER));
-	must_pass(git_futils_mv_atomic(STATUS_REPOSITORY_TEMP_FOLDER, TEST_STD_REPO_FOLDER));
-	must_pass(git_repository_open(&repo, TEST_STD_REPO_FOLDER));
-
-	// "nonexistent" does not exist in HEAD, Index or the worktree
-	error = git_status_file(&status_flags, repo, "nonexistent");
-	must_be_true(error == GIT_ENOTFOUND);
-
-	git_repository_free(repo);
-
-	git_futils_rmdir_r(TEMP_REPO_FOLDER, 1);
-END_TEST
-
-BEGIN_SUITE(status)
-	ADD_TEST(file0);
-
-	ADD_TEST(statuscb0);
-
-	ADD_TEST(singlestatus0);
-	ADD_TEST(singlestatus1);
-END_SUITE
\ No newline at end of file
diff --git a/tests/test_helpers.c b/tests/test_helpers.c
deleted file mode 100644
index 0900430..0000000
--- a/tests/test_helpers.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "common.h"
-#include "test_helpers.h"
-#include "fileops.h"
-
-int write_object_data(char *file, void *data, size_t len)
-{
-	git_file fd;
-	int ret;
-
-	if ((fd = p_creat(file, S_IREAD | S_IWRITE)) < 0)
-		return -1;
-	ret = p_write(fd, data, len);
-	p_close(fd);
-
-	return ret;
-}
-
-int write_object_files(const char *odb_dir, object_data *d)
-{
-	if (p_mkdir(odb_dir, 0755) < 0) {
-		int err = errno;
-		fprintf(stderr, "can't make directory \"%s\"", odb_dir);
-		if (err == EEXIST)
-			fprintf(stderr, " (already exists)");
-		fprintf(stderr, "\n");
-		return -1;
-	}
-
-	if ((p_mkdir(d->dir, 0755) < 0) && (errno != EEXIST)) {
-		fprintf(stderr, "can't make object directory \"%s\"\n", d->dir);
-		return -1;
-	}
-	if (write_object_data(d->file, d->bytes, d->blen) < 0) {
-		fprintf(stderr, "can't write object file \"%s\"\n", d->file);
-		return -1;
-	}
-
-	return 0;
-}
-
-int remove_object_files(const char *odb_dir, object_data *d)
-{
-	if (p_unlink(d->file) < 0) {
-		fprintf(stderr, "can't delete object file \"%s\"\n", d->file);
-		return -1;
-	}
-	if ((p_rmdir(d->dir) < 0) && (errno != ENOTEMPTY)) {
-		fprintf(stderr, "can't remove object directory \"%s\"\n", d->dir);
-		return -1;
-	}
-
-	if (p_rmdir(odb_dir) < 0) {
-		fprintf(stderr, "can't remove directory \"%s\"\n", odb_dir);
-		return -1;
-	}
-
-	return 0;
-}
-
-int remove_loose_object(const char *repository_folder, git_object *object)
-{
-	static const char *objects_folder = "objects/";
-
-	char *ptr, *full_path, *top_folder;
-	int path_length, objects_length;
-
-	assert(repository_folder && object);
-
-	objects_length = strlen(objects_folder);
-	path_length = strlen(repository_folder);
-	ptr = full_path = git__malloc(path_length + objects_length + GIT_OID_HEXSZ + 3);
-
-	strcpy(ptr, repository_folder);
-	strcpy(ptr + path_length, objects_folder);
-
-	ptr = top_folder = ptr + path_length + objects_length;
-	*ptr++ = '/';
-	git_oid_pathfmt(ptr, git_object_id(object));
-	ptr += GIT_OID_HEXSZ + 1;
-	*ptr = 0;
-
-	if (p_unlink(full_path) < 0) {
-		fprintf(stderr, "can't delete object file \"%s\"\n", full_path);
-		return -1;
-	}
-
-	*top_folder = 0;
-
-	if ((p_rmdir(full_path) < 0) && (errno != ENOTEMPTY)) {
-		fprintf(stderr, "can't remove object directory \"%s\"\n", full_path);
-		return -1;
-	}
-
-	free(full_path);
-
-	return GIT_SUCCESS;
-}
-
-int cmp_objects(git_rawobj *o, object_data *d)
-{
-	if (o->type != git_object_string2type(d->type))
-		return -1;
-	if (o->len != d->dlen)
-		return -1;
-	if ((o->len > 0) && (memcmp(o->data, d->data, o->len) != 0))
-		return -1;
-	return 0;
-}
-
-int copy_file(const char *src, const char *dst)
-{
-	git_fbuffer source_buf;
-	git_file dst_fd;
-	int error = GIT_ERROR;
-
-	if (git_futils_readbuffer(&source_buf, src) < GIT_SUCCESS)
-		return GIT_ENOTFOUND;
-
-	dst_fd = git_futils_creat_withpath(dst, 0644);
-	if (dst_fd < 0)
-		goto cleanup;
-
-	error = p_write(dst_fd, source_buf.data, source_buf.len);
-
-cleanup:
-	git_futils_freebuffer(&source_buf);
-	p_close(dst_fd);
-
-	return error;
-}
-
-int cmp_files(const char *a, const char *b)
-{
-	git_fbuffer buf_a, buf_b;
-	int error = GIT_ERROR;
-
-	if (git_futils_readbuffer(&buf_a, a) < GIT_SUCCESS)
-		return GIT_ERROR;
-
-	if (git_futils_readbuffer(&buf_b, b) < GIT_SUCCESS) {
-		git_futils_freebuffer(&buf_a);
-		return GIT_ERROR;
-	}
-
-	if (buf_a.len == buf_b.len && !memcmp(buf_a.data, buf_b.data, buf_a.len))
-		error = GIT_SUCCESS;
-
-	git_futils_freebuffer(&buf_a);
-	git_futils_freebuffer(&buf_b);
-
-	return error;
-}
-
-typedef struct {
-	size_t src_len, dst_len;
-	char *dst;
-} copydir_data;
-
-static int copy_filesystem_element_recurs(void *_data, char *source)
-{
-	copydir_data *data = (copydir_data *)_data;
-
-	data->dst[data->dst_len] = 0;
-	git_path_join(data->dst, data->dst, source + data->src_len);
-
-	if (git_futils_isdir(source) == GIT_SUCCESS)
-		return git_futils_direach(source, GIT_PATH_MAX, copy_filesystem_element_recurs, _data);
-
-	return copy_file(source, data->dst);
-}
-
-int copydir_recurs(const char *source_directory_path, const char *destination_directory_path)
-{
-	char source_buffer[GIT_PATH_MAX];
-	char dest_buffer[GIT_PATH_MAX];
-	copydir_data data;
-
-	/* Source has to exist, Destination hast to _not_ exist */
-	if (git_futils_isdir(source_directory_path) != GIT_SUCCESS ||
-		git_futils_isdir(destination_directory_path) == GIT_SUCCESS)
-		return GIT_EINVALIDPATH;
-
-	git_path_join(source_buffer, source_directory_path, "");
-	data.src_len = strlen(source_buffer);
-
-	git_path_join(dest_buffer, destination_directory_path, "");
-	data.dst = dest_buffer;
-	data.dst_len = strlen(dest_buffer);
-
-	return copy_filesystem_element_recurs(&data, source_buffer);
-}
-
-int open_temp_repo(git_repository **repo, const char *path)
-{
-	if (copydir_recurs(path, TEMP_REPO_FOLDER) < GIT_SUCCESS) {
-		printf("\nFailed to create temporary folder. Aborting test suite.\n");
-		exit(-1);
-	}
-
-	return git_repository_open(repo, TEMP_REPO_FOLDER);
-}
-
-void close_temp_repo(git_repository *repo)
-{
-	git_repository_free(repo);
-	if (git_futils_rmdir_r(TEMP_REPO_FOLDER, 1) < GIT_SUCCESS) {
-		printf("\nFailed to remove temporary folder. Aborting test suite.\n");
-		exit(-1);
-	}
-}
-
-static int remove_placeholders_recurs(void *filename, char *path)
-{
-	char passed_filename[GIT_PATH_MAX];
-	char *data = (char *)filename;
-
-	if (!git_futils_isdir(path))
-		return git_futils_direach(path, GIT_PATH_MAX, remove_placeholders_recurs, data);
-
-	if (git_path_basename_r(passed_filename, sizeof(passed_filename), path) < GIT_SUCCESS)
-		return GIT_EINVALIDPATH;
-
-	if (!strcmp(data, passed_filename))
-		return p_unlink(path);
-
-	return GIT_SUCCESS;
-}
-
-int remove_placeholders(char *directory_path, char *filename)
-{
-	char buffer[GIT_PATH_MAX];
-
-	if (git_futils_isdir(directory_path))
-		return GIT_EINVALIDPATH;
-
-	strcpy(buffer, directory_path);
-	return remove_placeholders_recurs(filename, buffer);
-}
diff --git a/tests/test_helpers.h b/tests/test_helpers.h
deleted file mode 100644
index 75027dd..0000000
--- a/tests/test_helpers.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDE_test_helpers_h__
-#define INCLUDE_test_helpers_h__
-
-#include "test_lib.h"
-#include <git2.h>
-
-#include "odb.h"
-
-#define TEST_REPOSITORY_NAME	"testrepo.git"
-#define REPOSITORY_FOLDER		TEST_RESOURCES "/" TEST_REPOSITORY_NAME "/"
-#define ODB_FOLDER				(REPOSITORY_FOLDER "objects/")
-#define TEST_INDEX_PATH			(REPOSITORY_FOLDER "index")
-#define TEST_INDEX2_PATH		(TEST_RESOURCES "/gitgit.index")
-#define TEST_INDEXBIG_PATH		(TEST_RESOURCES "/big.index")
-
-#define TEMP_FOLDER				""
-#define TEMP_REPO_FOLDER		TEMP_FOLDER TEST_REPOSITORY_NAME "/"
-#define TEMP_REPO_FOLDER_NS		TEMP_FOLDER TEST_REPOSITORY_NAME
-#define TEST_STD_REPO_FOLDER	TEMP_REPO_FOLDER ".git/"
-
-typedef struct object_data {
-    unsigned char *bytes;  /* (compressed) bytes stored in object store */
-    size_t        blen;    /* length of data in object store            */
-    char          *id;     /* object id (sha1)                          */
-    char          *type;   /* object type                               */
-    char          *dir;    /* object store (fan-out) directory name     */
-    char          *file;   /* object store filename                     */
-    unsigned char *data;   /* (uncompressed) object data                */
-    size_t        dlen;    /* length of (uncompressed) object data      */
-} object_data;
-
-extern int write_object_data(char *file, void *data, size_t len);
-
-extern int write_object_files(const char *odb_dir, object_data *d);
-
-extern int remove_object_files(const char *odb_dir, object_data *d);
-
-extern int cmp_objects(git_rawobj *o, object_data *d);
-
-extern int remove_loose_object(const char *odb_dir, git_object *object);
-
-extern int cmp_files(const char *a, const char *b);
-extern int copy_file(const char *source, const char *dest);
-extern int rmdir_recurs(const char *directory_path);
-extern int copydir_recurs(const char *source_directory_path, const char *destination_directory_path);
-extern int remove_placeholders(char *directory_path, char *filename);
-
-extern int open_temp_repo(git_repository **repo, const char *path);
-extern void close_temp_repo(git_repository *repo);
-
-#endif
-/* INCLUDE_test_helpers_h__ */
diff --git a/tests/test_lib.c b/tests/test_lib.c
deleted file mode 100755
index a4c39df..0000000
--- a/tests/test_lib.c
+++ /dev/null
@@ -1,198 +0,0 @@
-#include <assert.h>
-#include <setjmp.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include "test_lib.h"
-
-#define DO_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE)))
-#define GIT_MAX_TEST_CASES 64
-
-struct git_test {
-	char *name;
-	char *message;
-	char *failed_pos;
-	char *description;
-	char *error_message;
-
-	git_testfunc function;
-	unsigned failed:1, ran:1;
-	jmp_buf *jump;
-};
-
-struct git_testsuite {
-	char *name;
-	int count, fail_count;
-	git_test *list[GIT_MAX_TEST_CASES];
-};
-
-static void test_free(git_test *t)
-{
-	if (t) {
-		free(t->name);
-		free(t->description);
-		free(t->failed_pos);
-		free(t->message);
-		free(t->error_message);
-		free(t);
-	}
-}
-
-static void test_run(git_test *tc)
-{
-	jmp_buf buf;
-	tc->jump = &buf;
-
-	if (setjmp(buf) == 0) {
-		tc->ran = 1;
-		(tc->function)(tc);
-	}
-
-	tc->jump = 0;
-}
-
-static git_test *create_test(git_testfunc function)
-{
-	git_test *t = DO_ALLOC(git_test);
-
-	memset(t, 0x0, sizeof(git_test));
-	t->function = function;
-
-	return t;
-}
-
-void git_test__init(git_test *t, const char *name, const char *description)
-{
-	t->name = strdup(name);
-	t->description = strdup(description);
-}
-
-
-/*-------------------------------------------------------------------------*
- * Public assert methods
- *-------------------------------------------------------------------------*/
-
-static void fail_test(git_test *tc, const char *file, int line, const char *message)
-{
-	char buf[1024];
-	const char *last_error = git_lasterror();
-
-	snprintf(buf, 1024, "%s:%d", file, line);
-
-	tc->failed = 1;
-	tc->message = strdup(message);
-	tc->failed_pos = strdup(buf);
-
-	if (last_error)
-		tc->error_message = strdup(last_error);
-
-	if (tc->jump != 0)
-		longjmp(*(tc->jump), 0);
-}
-
-void git_test__fail(git_test *tc, const char *file, int line, const char *message)
-{
-	fail_test(tc, file, line, message);
-}
-
-void git_test__assert(git_test *tc, const char *file, int line, const char *message, int condition)
-{
-	if (condition == 0)
-		fail_test(tc, file, line, message);
-}
-
-void git_test__assert_pass(git_test *tc, const char *file, int line, const char *message, int ret_value)
-{
-	if (ret_value < 0)
-		fail_test(tc, file, line, message);
-}
-
-/*-------------------------------------------------------------------------*
- * Test Suite
- *-------------------------------------------------------------------------*/
-
-static void testsuite_init(git_testsuite *ts)
-{
-	ts->count = 0;
-	ts->fail_count = 0;
-	memset(ts->list, 0, sizeof(ts->list));
-}
-
-git_testsuite *git_testsuite_new(const char *name)
-{
-	git_testsuite *ts = DO_ALLOC(git_testsuite);
-	testsuite_init(ts);
-	ts->name = strdup(name);
-	return ts;
-}
-
-static void free_suite(git_testsuite *ts)
-{
-	unsigned int n;
-
-	for (n = 0; n < GIT_MAX_TEST_CASES; n++)
-		if (ts->list[n])
-			test_free(ts->list[n]);
-
-	free(ts->name);
-	free(ts);
-}
-
-void git_testsuite_add(git_testsuite *ts, git_testfunc test)
-{
-	assert(ts->count < GIT_MAX_TEST_CASES);
-	ts->list[ts->count++] = create_test(test);
-}
-
-static void print_details(git_testsuite *ts)
-{
-	int i;
-	int failCount = 0;
-
-	if (ts->fail_count == 0) {
-		const char *testWord = ts->count == 1 ? "test" : "tests";
-		printf("OK (%d %s)\n", ts->count, testWord);
-	} else {
-		printf("Failed (%d failures):\n", ts->fail_count);
-
-		for (i = 0 ; i < ts->count ; ++i) {
-			git_test *tc = ts->list[i];
-			if (tc->failed) {
-				failCount++;
-				printf("  %d) \"%s\" [test %s @ %s]\n\t%s\n",
-					failCount, tc->description, tc->name, tc->failed_pos, tc->message);
-				if (tc->error_message)
-					printf("\tError: %s\n", tc->error_message);
-			}
-		}
-	}
-}
-
-int git_testsuite_run(git_testsuite *ts)
-{
-	int i, fail_count;
-
-	printf("Suite \"%s\": ", ts->name);
-
-	for (i = 0 ; i < ts->count ; ++i) {
-		git_test *tc = ts->list[i];
-
-		test_run(tc);
-		if (tc->failed) {
-			ts->fail_count++;
-			putchar('F');
-		} else
-			putchar('.');
-
-		fflush(stdout);
-	}
-	printf("\n  ");
-	print_details(ts);
-	fail_count = ts->fail_count;
-
-	free_suite(ts);
-	return fail_count;
-}
-
diff --git a/tests/test_lib.h b/tests/test_lib.h
deleted file mode 100755
index fc75ed7..0000000
--- a/tests/test_lib.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef __LIBGIT2_TEST_H__
-#define __LIBGIT2_TEST_H__
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "common.h"
-#include <git2.h>
-
-#define DECLARE_SUITE(SNAME) extern git_testsuite *libgit2_suite_##SNAME(void)
-#define SUITE_NAME(SNAME) libgit2_suite_##SNAME
-
-#define BEGIN_SUITE(SNAME) \
-	git_testsuite *libgit2_suite_##SNAME(void) {\
-		git_testsuite *_gitsuite = git_testsuite_new(#SNAME);
-
-#define ADD_TEST(TNAME) \
-	git_testsuite_add(_gitsuite, _gittest__##TNAME);
-
-#define END_SUITE \
-		return _gitsuite;\
-	}
-
-#define BEGIN_TEST(TNAME, DESC) \
-	static void _gittest__##TNAME(git_test *_gittest) { \
-		git_test__init(_gittest, #TNAME, DESC); \
-		git_clearerror();\
-		{\
-
-#define END_TEST }}
-
-typedef struct git_test git_test;
-typedef struct git_testsuite git_testsuite;
-typedef void (*git_testfunc)(git_test *);
-typedef git_testsuite *(*libgit2_suite)(void);
-
-void git_test__init(git_test *t, const char *name, const char *description);
-void git_test__fail(git_test *tc, const char *file, int line, const char *message);
-void git_test__assert(git_test *tc, const char *file, int line, const char *message, int condition);
-void git_test__assert_pass(git_test *tc, const char *file, int line, const char *message, int ret_value);
-
-#define must_pass(expr) git_test__assert_pass(_gittest, __FILE__, __LINE__, "Method failed: " #expr, (expr))
-#define must_fail(expr) git_test__assert(_gittest, __FILE__, __LINE__, "Expected method to fail: " #expr, (expr) < 0)
-#define must_be_true(expr) git_test__assert(_gittest, __FILE__, __LINE__, "Expression is not true: " #expr, !!(expr))
-
-git_testsuite *git_testsuite_new(const char *name);
-void git_testsuite_add(git_testsuite *ts, git_testfunc test);
-int git_testsuite_run(git_testsuite *ts);
-
-#endif
-
diff --git a/tests/test_main.c b/tests/test_main.c
deleted file mode 100644
index c9f8da3..0000000
--- a/tests/test_main.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file.  (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING.  If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include <string.h>
-#include <git2.h>
-
-#include "test_lib.h"
-#include "test_helpers.h"
-
-DECLARE_SUITE(core);
-DECLARE_SUITE(rawobjects);
-DECLARE_SUITE(objread);
-DECLARE_SUITE(objwrite);
-DECLARE_SUITE(commit);
-DECLARE_SUITE(revwalk);
-DECLARE_SUITE(index);
-DECLARE_SUITE(hashtable);
-DECLARE_SUITE(tag);
-DECLARE_SUITE(tree);
-DECLARE_SUITE(refs);
-DECLARE_SUITE(repository);
-DECLARE_SUITE(threads);
-DECLARE_SUITE(config);
-DECLARE_SUITE(remotes);
-DECLARE_SUITE(buffers);
-DECLARE_SUITE(status);
-
-static libgit2_suite suite_methods[]= {
-	SUITE_NAME(core),
-	SUITE_NAME(rawobjects),
-	SUITE_NAME(objread),
-	SUITE_NAME(objwrite),
-	SUITE_NAME(commit),
-	SUITE_NAME(revwalk),
-	SUITE_NAME(index),
-	SUITE_NAME(hashtable),
-	SUITE_NAME(tag),
-	SUITE_NAME(tree),
-	SUITE_NAME(refs),
-	SUITE_NAME(repository),
-	SUITE_NAME(threads),
-	SUITE_NAME(config),
-	SUITE_NAME(remotes),
-	SUITE_NAME(buffers),
-	SUITE_NAME(status),
-};
-
-#define GIT_SUITE_COUNT (ARRAY_SIZE(suite_methods))
-
-#ifdef GIT_WIN32
-int __cdecl
-#else
-int
-#endif
-main(int GIT_UNUSED(argc), char *GIT_UNUSED(argv[]))
-{
-	unsigned int i, failures;
-
-	GIT_UNUSED_ARG(argc);
-	GIT_UNUSED_ARG(argv);
-
-	failures = 0;
-
-	for (i = 0; i < GIT_SUITE_COUNT; ++i)
-		failures += git_testsuite_run(suite_methods[i]());
-
-	return failures ? -1 : 0;
-}
-
diff --git a/tests/vector.c b/tests/vector.c
new file mode 100644
index 0000000..8f6f826
--- /dev/null
+++ b/tests/vector.c
@@ -0,0 +1,64 @@
+#include "clay_libgit2.h"
+#include "vector.h"
+
+/* initial size of 1 would cause writing past array bounds */
+void test_vector__0(void)
+{
+  git_vector x;
+  int i;
+  git_vector_init(&x, 1, NULL);
+  for (i = 0; i < 10; ++i) {
+    git_vector_insert(&x, (void*) 0xabc);
+  }
+  git_vector_free(&x);
+}
+
+
+/* don't read past array bounds on remove() */
+void test_vector__1(void)
+{
+  git_vector x;
+  // make initial capacity exact for our insertions.
+  git_vector_init(&x, 3, NULL);
+  git_vector_insert(&x, (void*) 0xabc);
+  git_vector_insert(&x, (void*) 0xdef);
+  git_vector_insert(&x, (void*) 0x123);
+
+  git_vector_remove(&x, 0);  // used to read past array bounds.
+  git_vector_free(&x);
+}
+
+
+static int test_cmp(const void *a, const void *b)
+{
+	return *(const int *)a - *(const int *)b;
+}
+
+/* remove duplicates */
+void test_vector__2(void)
+{
+	git_vector x;
+	int *ptrs[2];
+
+	ptrs[0] = git__malloc(sizeof(int));
+	ptrs[1] = git__malloc(sizeof(int));
+
+	*ptrs[0] = 2;
+	*ptrs[1] = 1;
+
+	must_pass(git_vector_init(&x, 5, test_cmp));
+	must_pass(git_vector_insert(&x, ptrs[0]));
+	must_pass(git_vector_insert(&x, ptrs[1]));
+	must_pass(git_vector_insert(&x, ptrs[1]));
+	must_pass(git_vector_insert(&x, ptrs[0]));
+	must_pass(git_vector_insert(&x, ptrs[1]));
+	must_be_true(x.length == 5);
+	git_vector_uniq(&x);
+	must_be_true(x.length == 2);
+	git_vector_free(&x);
+
+	free(ptrs[0]);
+	free(ptrs[1]);
+}
+
+