This is the start of a rework of the branch cache: Part 1: extract branchmap from localrepo Part 2: refactor branchmap into an object to simplify its usage Part 3: Make is handle filtered repository