From 998f7b3dd76afbf462785a757b24a3554ad8534d Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Wed, 7 Mar 2012 10:52:17 -0800 Subject: [PATCH] Fix issues raised on pull request This resolves the comments on pull request #590 --- src/errors.c | 2 +- src/odb.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/errors.c b/src/errors.c index 0454856cf..c25fa7519 100644 --- a/src/errors.c +++ b/src/errors.c @@ -124,7 +124,7 @@ void giterr_set(int error_class, const char *string, ...) va_list arglist; git_error *error; const char *oserr = - (error_class == GITERR_OS && errno > 0) ? strerror(errno) : NULL; + (error_class == GITERR_OS && errno != 0) ? strerror(errno) : NULL; error = &GIT_GLOBAL->error_t; free(error->message); diff --git a/src/odb.c b/src/odb.c index 7ca8c21fe..edb9c72a0 100644 --- a/src/odb.c +++ b/src/odb.c @@ -319,12 +319,8 @@ static int add_backend_internal(git_odb *odb, git_odb_backend *backend, int prio assert(odb && backend); - if (backend->odb != NULL && backend->odb != odb) { - /* - * TODO: Not sure how to convert this! - */ - return git__throw(GIT_EBUSY, "The backend is already owned by another ODB"); - } + /* Check if the backend is already owned by another ODB */ + assert(!backend->odb || backend->odb == odb); internal = git__malloc(sizeof(backend_internal)); GITERR_CHECK_ALLOC(internal); -- 2.39.5