commit: use generations in paint_down_to_common()
[gitweb.git] / sha1_name.c
index e7c18ffc26daf1962f90da9ff5c16cc608149d9d..c9dead6b80f4e74a1a11ccd17dd4a1d5d888452a 100644 (file)
@@ -896,7 +896,7 @@ struct object *peel_to_type(const char *name, int namelen,
                if (o->type == OBJ_TAG)
                        o = ((struct tag*) o)->tagged;
                else if (o->type == OBJ_COMMIT)
-                       o = &(((struct commit *) o)->tree->object);
+                       o = &(get_commit_tree(((struct commit *)o))->object);
                else {
                        if (name)
                                error("%.*s: expected %s type, but the object "