Compacts the commit graph for the resource by deleting working state commits that match the provided strategy. Persists commits that are pointed to by branches. Returns the set of commits that were compacted. Throws if the resource doesn’t exist.