]> source.dussan.org Git - jgit.git/commit
Fix RevWalkUtils.findBranchesReachableFrom not finding some branches 18/20618/5
authorRobin Stocker <robin@nibor.org>
Tue, 14 Jan 2014 15:56:01 +0000 (16:56 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 11 Feb 2014 21:43:35 +0000 (22:43 +0100)
commit2852b6a07d78086e155c2f658ff9b5b235d1fb4e
tree33ca6aee2c30851ae2d3be0d53d7fa166e9e754f
parent1b5bb265dcf88141ef70822a673c948f93d31cd1
Fix RevWalkUtils.findBranchesReachableFrom not finding some branches

The "cut off" optimization causes it to not include branches that
contain the specified commit but happen to share commits with a branch
that does not contain the commit.

An example:

      -B foo
        \
    -A---C master

findBranchesReachableFrom for commit A with both branches as input may
not return master (depending on the order of the input). The reason is
that A is not contained in foo, and therefore the old code would put B
in the cutOff set. When then walking the master commits and B is
checked, it is found in the cutOff set and the walk is aborted, causing
master not to be returned even though it should.

Bug: 425674
Change-Id: I2c0c406ce5fcc9a03538b483473af930d4895d30
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java