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; }
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 }