Bypass looking up the object type if we know it

The walker knows that what it gets back are commits, so avoid calling
into the library to ask for the type but wrap it directly.