Actually, any use of ObjectId as a parameter probably should be AnyObjectId instead.  This permits the mutable variant to be passed in.  Normally that might be a problem, since the caller can change its value after we return.  But it shouldn't be an issue here, because we're doing a lookup of the object in the RevWalk and holding onto the located result.  So we're copying the value we were given, which makes it OK to take the MutableObjectId variant.