Cleaned up repo depth logic.