summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-03-14 00:33:45 +0100
committerVicent Marti <tanoku@gmail.com>2011-03-15 02:56:32 +0200
commit1ee32c6dd98809e64b4178e0260dca648e287613 (patch)
tree71a9a313b65302f8a3ed4357691eb5f82545b727
parentbd1aa741a4e7b2b83991e7bccbfe55960929af9e (diff)
downloadlibgit2-1ee32c6dd98809e64b4178e0260dca648e287613.tar.gz
Add test case for issue GH-86
-rw-r--r--tests/t09-tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/t09-tree.c b/tests/t09-tree.c
index 6bc2a84bd..dfd266d16 100644
--- a/tests/t09-tree.c
+++ b/tests/t09-tree.c
@@ -66,6 +66,10 @@ BEGIN_TEST(read1, "read a tree from the repository")
must_be_true(git_tree_entrycount(tree) == 3);
+ /* GH-86: git_object_lookup() should also check the type if the object comes from the cache */
+ must_be_true(git_object_lookup(&obj, repo, &id, GIT_OBJ_TREE) == 0);
+ must_be_true(git_object_lookup(&obj, repo, &id, GIT_OBJ_BLOB) == GIT_EINVALIDTYPE);
+
entry = git_tree_entry_byname(tree, "README");
must_be_true(entry != NULL);