summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-05-07 15:42:13 +0200
committernulltoken <emeric.fermas@gmail.com>2012-05-08 10:05:14 +0200
commitcb0ce16bbe8efe2098ef9cfffcf158301b036565 (patch)
tree4f817a06c5f51eabf90eaf9c9c033e7fee6a14af /src/object.c
parent9fb70f378ace77bf20ec67c5bce044114a0e0f93 (diff)
downloadlibgit2-cb0ce16bbe8efe2098ef9cfffcf158301b036565.tar.gz
object: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing object by specifying an incorrect type
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object.c b/src/object.c
index e02bd69ba..02be5dac8 100644
--- a/src/object.c
+++ b/src/object.c
@@ -150,8 +150,8 @@ int git_object_lookup_prefix(
if (type != GIT_OBJ_ANY && type != odb_obj->raw.type) {
git_odb_object_free(odb_obj);
- giterr_set(GITERR_INVALID, "The given type does not match the type on the ODB");
- return -1;
+ giterr_set(GITERR_ODB, "The given type does not match the type on the ODB");
+ return GIT_ENOTFOUND;
}
type = odb_obj->raw.type;