]> source.dussan.org Git - jgit.git/commitdiff
Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom 87/7687/3
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 8 Sep 2012 10:07:24 +0000 (12:07 +0200)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 8 Sep 2012 10:08:07 +0000 (12:08 +0200)
This methods is for finding branches only.

Change-Id: Ic68b5295ff814401890f0592ae95851554706ca6

org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java

index 83f5f924e5b383e72992ae767e17c7ee9f2b7e08..f223dea445317c3e01c5b72862d8975ac0894992 100644 (file)
@@ -165,7 +165,10 @@ public final class RevWalkUtils {
                final int SKEW = 24*3600; // one day clock skew
 
                for (Ref ref : refs) {
-                       RevCommit headCommit = revWalk.parseCommit(ref.getObjectId());
+                       RevObject maybehead = revWalk.parseAny(ref.getObjectId());
+                       if (!(maybehead instanceof RevCommit))
+                               continue;
+                       RevCommit headCommit = (RevCommit) maybehead;
 
                        // if commit is in the ref branch, then the tip of ref should be
                        // newer than the commit we are looking for. Allow for a large