Commit 1cbc02b603bd240e29f2ca64f4f9672a32c526b2

Stefan Sperling 2018-06-21T21:02:45

fix object type check in got_open_object_as_tree()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object.c b/lib/object.c
index 559dc54..f5552d9 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -1135,7 +1135,7 @@ got_object_open_as_tree(struct got_tree_object **tree,
 	err = got_object_open(&obj, repo, id);
 	if (err)
 		return err;
-	if (got_object_get_type(obj) != GOT_OBJ_TYPE_COMMIT) {
+	if (got_object_get_type(obj) != GOT_OBJ_TYPE_TREE) {
 		err = got_error(GOT_ERR_OBJ_TYPE);
 		goto done;
 	}