key = r.getObjectId();
tags.put(key, r);
}
// combined flags of all the candidate instances
final RevFlagSet allFlags = new RevFlagSet();
/**
* Tracks the depth of each tag as we find them.
*/
class Candidate {
final Ref tag;
final RevFlag flag;
/**
* This field counts number of commits that are reachable from
* the tip but not reachable from the tag.
*/
int depth;
Candidate(RevCommit commit, Ref tag) {
this.tag = tag;
this.flag = w.newFlag(tag.getName());
// we'll mark all the nodes reachable from this tag accordingly
allFlags.add(flag);
w.carry(flag);
commit.add(flag);
// As of this writing, JGit carries a flag from a child to its parents
// right before RevWalk.next() returns, so all the flags that are added
// must be manually carried to its parents. If that gets fixed,