From: Robin Rosenberg Date: Sat, 8 Sep 2012 10:07:24 +0000 (+0200) Subject: Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom X-Git-Tag: v2.2.0.201212191850-r~101^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F7687%2F3;p=jgit.git Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom This methods is for finding branches only. Change-Id: Ic68b5295ff814401890f0592ae95851554706ca6 --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java index 83f5f924e5..f223dea445 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java @@ -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