Exemplo n.º 1
0
static git_odb *open_sqlite_odb(void)
{
    git_odb *odb;
    git_odb_backend *sqlite;

    if (git_odb_new(&odb) < GIT_SUCCESS)
        return NULL;

    if (git_odb_backend_sqlite(&sqlite, ":memory") < GIT_SUCCESS)
        return NULL;

    if (git_odb_add_backend(odb, sqlite, 0) < GIT_SUCCESS)
        return NULL;

    return odb;
}
Exemplo n.º 2
0
static git_odb *open_sqlite_odb(void)
{
#ifdef GIT2_SQLITE_BACKEND
	git_odb *odb;
	git_odb_backend *sqlite;

	if (git_odb_new(&odb) < GIT_SUCCESS)
		return NULL;

	if (git_odb_backend_sqlite(&sqlite, ":memory") < GIT_SUCCESS)
		return NULL;

	if (git_odb_add_backend(odb, sqlite, 0) < GIT_SUCCESS)
		return NULL;

	return odb;
#else
	return NULL;
#endif
}