Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-12-01 04:31:42 +0400
committerBen Straub <bs@github.com>2012-12-01 04:31:42 +0400
commitc7231c45fecf6c0ae91815a82db7e98c94689497 (patch)
tree33426a5463917d64b1f160f8083f3dfbd4217fe3 /src/odb.c
parent4ec197f3049d203739066e0c2d2c5c39f78fd808 (diff)
Deploy GITERR_CHECK_VERSION
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/odb.c b/src/odb.c
index e35e4caca..b6d1f798d 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -363,26 +363,13 @@ int git_odb_new(git_odb **out)
return 0;
}
-static bool backend_has_valid_version(git_odb_backend *backend)
-{
- if (!backend)
- return true;
-
- if (backend->version > 0 && backend->version <= GIT_ODB_BACKEND_VERSION)
- return true;
-
- giterr_set(GITERR_INVALID, "Invalid version %d on git_odb_backend", backend->version);
- return false;
-}
-
static int add_backend_internal(git_odb *odb, git_odb_backend *backend, int priority, int is_alternate)
{
backend_internal *internal;
assert(odb && backend);
- if (!backend_has_valid_version(backend))
- return -1;
+ GITERR_CHECK_VERSION(backend, GIT_ODB_BACKEND_VERSION, "git_odb_backend");
/* Check if the backend is already owned by another ODB */
assert(!backend->odb || backend->odb == odb);