Commit bd1aa741 by Ben Noordhuis Committed by Vicent Marti

git_object_lookup() should also check the type if the object comes from the cache

parent 7c8a7b91
......@@ -276,6 +276,9 @@ int git_object_lookup(git_object **object_out, git_repository *repo, const git_o
object = git_hashtable_lookup(repo->objects, id);
if (object != NULL) {
if (type != GIT_OBJ_ANY && type != object->source.raw.type)
return GIT_EINVALIDTYPE;
*object_out = object;
object->lru = ++repo->lru_counter;
object->can_free = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment