build: respect order in compareBranches (#304)
For non-delta we don't treat branches as a set, but rather as a slice
where order is significant. Relying on this makes it easier to reason
about and implement. It also avoids the footgun we had around accidently
mutating repobranches on the read path when sorting. The order is
significant in the shard since each document records which branches it
is part of by the index.
Note we had to remove the IndexStateCorrupt test. We may want a way to
check this invariant somewhere else since this feels like a bug we could
introduce with delta.
Test Plan: unit tests.