You should hang onto an ObjectReader in this class, and make the caller release() you so you can release() your ObjectReader. Then that same ObjectReader can be used for all data access with TreeWalk or RevWalk instances.