Example usage for org.eclipse.jgit.revwalk RevWalk setRewriteParents

List of usage examples for org.eclipse.jgit.revwalk RevWalk setRewriteParents

Introduction

In this page you can find the example usage for org.eclipse.jgit.revwalk RevWalk setRewriteParents.

Prototype

public void setRewriteParents(boolean rewrite) 

Source Link

Document

Set whether to rewrite parent pointers when filtering by modified paths.

Usage

From source file:com.google.gitiles.blame.BlameCacheImpl.java

License:Open Source License

@Override
public ObjectId findLastCommit(Repository repo, ObjectId commitId, String path) throws IOException {
    // Default implementation does no caching.
    RevWalk rw = new RevWalk(repo);
    try {/*from w ww  . j a va 2s . c o m*/
        rw.markStart(rw.parseCommit(commitId));
        rw.setRewriteParents(false);
        // Don't use rename detection, even though BlameGenerator does. It is not
        // possible for a commit to modify a path when not doing rename detection
        // but to not modify the same path when taking renames into account.
        rw.setTreeFilter(AndTreeFilter.create(PathFilterGroup.createFromStrings(path), TreeFilter.ANY_DIFF));
        return rw.next();
    } finally {
        rw.release();
    }
}

From source file:kr.re.ec.grigit.graph.ui.RevWalker.java

License:Eclipse Distribution License

protected RevWalk createWalk() {
    RevWalk result;
    if (objects)// ww  w  . ja  v a2 s  .  com
        result = new ObjectWalk(db);
    else if (argWalk != null)
        result = argWalk;
    else
        result = argWalk = new RevWalk(db);
    result.setRewriteParents(false);
    return result;
}