Package com.google.gerrit.server.git
Class CommitUtil
- java.lang.Object
-
- com.google.gerrit.server.git.CommitUtil
-
public class CommitUtil extends Object
Static utilities for working withRevCommit
s.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jgit.lib.ObjectId
createRevertCommit(String message, ChangeNotes notes, CurrentUser user)
Allows creating a revert commit.org.eclipse.jgit.lib.ObjectId
createRevertCommit(String message, ChangeNotes notes, CurrentUser user, org.eclipse.jgit.lib.ObjectId generatedChangeId, Timestamp ts, org.eclipse.jgit.lib.ObjectInserter oi, org.eclipse.jgit.revwalk.RevWalk revWalk)
static CommitInfo
toCommitInfo(org.eclipse.jgit.revwalk.RevCommit commit)
static CommitInfo
toCommitInfo(org.eclipse.jgit.revwalk.RevCommit commit, org.eclipse.jgit.revwalk.RevWalk walk)
-
-
-
Method Detail
-
toCommitInfo
public static CommitInfo toCommitInfo(org.eclipse.jgit.revwalk.RevCommit commit) throws IOException
- Throws:
IOException
-
toCommitInfo
public static CommitInfo toCommitInfo(org.eclipse.jgit.revwalk.RevCommit commit, org.eclipse.jgit.revwalk.RevWalk walk) throws IOException
- Throws:
IOException
-
createRevertCommit
public org.eclipse.jgit.lib.ObjectId createRevertCommit(String message, ChangeNotes notes, CurrentUser user) throws ResourceConflictException, IOException
Allows creating a revert commit.- Parameters:
message
- Commit message for the revert commit.notes
- ChangeNotes of the change being reverted.user
- Current User performing the revert.- Returns:
- ObjectId that represents the newly created commit.
- Throws:
ResourceConflictException
- Can't revert the initial commit.IOException
- Thrown in case of I/O errors.
-
createRevertCommit
public org.eclipse.jgit.lib.ObjectId createRevertCommit(String message, ChangeNotes notes, CurrentUser user, org.eclipse.jgit.lib.ObjectId generatedChangeId, Timestamp ts, org.eclipse.jgit.lib.ObjectInserter oi, org.eclipse.jgit.revwalk.RevWalk revWalk) throws ResourceConflictException, IOException
- Parameters:
message
- Commit message for the revert commit.notes
- ChangeNotes of the change being reverted.user
- Current User performing the revert.generatedChangeId
- The changeId for the commit message, can be null since it is not needed for commits, only for changes.ts
- Timestamp of creation for the commit.oi
- ObjectInserter for inserting the newly created commit.revWalk
- Used for parsing the original commit.- Returns:
- ObjectId that represents the newly created commit.
- Throws:
ResourceConflictException
- Can't revert the initial commit.IOException
- Thrown in case of I/O errors.
-
-