Merge git://ozlabs.org/~paulus/gitk
[gitweb.git] / upload-pack.c
index 6142421ea1172f7fe6b57486a4f41b81d92bab85..95d83135ae95b2fa7980c69cbd7b49e3a6ff2d0a 100644 (file)
@@ -603,6 +603,8 @@ static void receive_needs(void)
                        object = parse_object(sha1);
                        if (!object)
                                die("did not find object for %s", line);
+                       if (object->type != OBJ_COMMIT)
+                               die("invalid shallow object %s", sha1_to_hex(sha1));
                        object->flags |= CLIENT_SHALLOW;
                        add_object_array(object, NULL, &shallows);
                        continue;