Package com.google.gerrit.server.patch
Class DiffUtil
- java.lang.Object
 - 
- com.google.gerrit.server.patch.DiffUtil
 
 
- 
public class DiffUtil extends Object
A utility class used by the diff cache interfacesGitModifiedFilesCacheandModifiedFilesCache. 
- 
- 
Constructor Summary
Constructors Constructor Description DiffUtil() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanareRelated(org.eclipse.jgit.revwalk.RevCommit commitA, org.eclipse.jgit.revwalk.RevCommit commitB)Returns true if the commitA and commitB parameters are parent/child, if they have a common parent, or if any of them is a root or merge commit.static org.eclipse.jgit.revwalk.RevCommitgetRevCommit(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId commitId)Returns the RevCommit object given the 20 bytes commitId SHA-1 hash.static org.eclipse.jgit.lib.ObjectIdgetTreeId(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId commitId)Returns the Git tree object ID pointed to by the commitId parameter.static intstringSize(String str) 
 - 
 
- 
- 
Method Detail
- 
getTreeId
public static org.eclipse.jgit.lib.ObjectId getTreeId(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId commitId) throws IOExceptionReturns the Git tree object ID pointed to by the commitId parameter.- Parameters:
 rw- aRevWalkof an opened repository that is used to walk the commit graph.commitId- 20 bytes commitId SHA-1 hash.- Returns:
 - Git tree object ID pointed to by the commitId.
 - Throws:
 IOException
 
- 
getRevCommit
public static org.eclipse.jgit.revwalk.RevCommit getRevCommit(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId commitId) throws IOExceptionReturns the RevCommit object given the 20 bytes commitId SHA-1 hash.- Parameters:
 rw- aRevWalkof an opened repository that is used to walk the commit graph.commitId- 20 bytes commitId SHA-1 hash- Returns:
 - The RevCommit representing the commit in Git
 - Throws:
 IOException- a pack file or loose object could not be read while parsing the commits.
 
- 
areRelated
public static boolean areRelated(org.eclipse.jgit.revwalk.RevCommit commitA, org.eclipse.jgit.revwalk.RevCommit commitB)Returns true if the commitA and commitB parameters are parent/child, if they have a common parent, or if any of them is a root or merge commit. 
- 
stringSize
public static int stringSize(String str)
 
 - 
 
 -