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 withRevCommits.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Change.IdcreateRevertChange(ChangeNotes notes, CurrentUser user, RevertInput input, Instant timestamp)Allows creating a revert change.org.eclipse.jgit.lib.ObjectIdcreateRevertCommit(String message, ChangeNotes notes, CurrentUser user, Instant ts)Wrapper function for creating a revert Commit.static CommitInfotoCommitInfo(org.eclipse.jgit.revwalk.RevCommit commit)static CommitInfotoCommitInfo(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
-
createRevertChange
public Change.Id createRevertChange(ChangeNotes notes, CurrentUser user, RevertInput input, Instant timestamp) throws RestApiException, UpdateException, org.eclipse.jgit.errors.ConfigInvalidException, IOException
Allows creating a revert change.- Parameters:
notes- ChangeNotes of the change being reverted.user- Current User performing the revert.input- the RevertInput entity for conducting the revert.timestamp- timestamp for the created change.- Returns:
- ObjectId that represents the newly created commit.
- Throws:
RestApiExceptionUpdateExceptionorg.eclipse.jgit.errors.ConfigInvalidExceptionIOException
-
createRevertCommit
public org.eclipse.jgit.lib.ObjectId createRevertCommit(String message, ChangeNotes notes, CurrentUser user, Instant ts) throws RestApiException, IOException
Wrapper function for 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.ts- Timestamp of creation for the commit.- Returns:
- ObjectId that represents the newly created commit.
- Throws:
RestApiExceptionIOException
-
-