In change If9a3c6f03f6dab4074440472faa17d7af565f717, the all incoming commits are considered in the MergeSorter when determining if a commit is missing a dependency from other branches. Support this in RebaseSorter as well. Also refactor this as part of the constructor of MergeSorter and RebaseSorter, instead of passing it to the sort() function every time. Change-Id: I882569d582db9b57b9301686059189b1f3a22e64