AFAIK, Repository.Commits property return all commits reachable from current branch.
I would like to get all possible commits, regardless the branch. I am using the following command :
var commitsToRewrite = repository.Branches.SelectMany(x => x.Commits)
.GroupBy(x => x.Sha)
.Select(x => x.First())
.ToArray();
It is slow but it seems to work (maybe I missed some special cases that are not covered). Is this the right way to do ? Is there a more efficient, faster way ?