]> git.proxmox.com Git - libgit2.git/commitdiff
Fix issues raised on pull request
authorRussell Belfer <arrbee@arrbee.com>
Wed, 7 Mar 2012 18:52:17 +0000 (10:52 -0800)
committerRussell Belfer <arrbee@arrbee.com>
Wed, 7 Mar 2012 18:52:17 +0000 (10:52 -0800)
This resolves the comments on pull request #590

src/errors.c
src/odb.c

index 0454856cfd39ecfa105d3fbaeb7f06aeea34ce9f..c25fa7519b666ce204e869b42df3d8146057ec2c 100644 (file)
@@ -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);
index 7ca8c21fe8461c8f63964b87dd376ded8e63c166..edb9c72a0bf029c156b0441b38c61d249fbbe948 100644 (file)
--- 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);