summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2012-11-28 11:47:38 +0100
committerVicent Marti <tanoku@gmail.com>2012-11-28 11:47:38 +0100
commitae2018917046da49f5926a3056360246d5abead2 (patch)
tree6e8241656c537a9069b4b1e70102526429ef17e8
parent9507a434c6a1e70ccd8a2678fe35b092105be1db (diff)
downloadlibgit2-ae2018917046da49f5926a3056360246d5abead2.tar.gz
object: Raise proper code on invalid object type
-rw-r--r--src/object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object.c b/src/object.c
index f71ee48d3..392fd80a8 100644
--- a/src/object.c
+++ b/src/object.c
@@ -87,7 +87,7 @@ int git_object__from_odb_object(
git_object *object = NULL;
if (type != GIT_OBJ_ANY && type != odb_obj->raw.type) {
- giterr_set(GITERR_ODB, "The requested type does not match the type in the ODB");
+ giterr_set(GITERR_INVALID, "The requested type does not match the type in the ODB");
return GIT_ENOTFOUND;
}
@@ -161,7 +161,7 @@ int git_object_lookup_prefix(
if (object != NULL) {
if (type != GIT_OBJ_ANY && type != object->type) {
git_object_free(object);
- giterr_set(GITERR_ODB, "The given type does not match the type in ODB");
+ giterr_set(GITERR_INVALID, "The requested type does not match the type in ODB");
return GIT_ENOTFOUND;
}