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 Change.Id
createRevertChange(ChangeNotes notes, CurrentUser user, RevertInput input, Timestamp timestamp)
Allows creating a revert change.org.eclipse.jgit.lib.ObjectId
createRevertCommit(String message, ChangeNotes notes, CurrentUser user, Timestamp ts)
Wrapper function for creating a revert Commit.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
-
createRevertChange
public Change.Id createRevertChange(ChangeNotes notes, CurrentUser user, RevertInput input, Timestamp 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:
RestApiException
UpdateException
org.eclipse.jgit.errors.ConfigInvalidException
IOException
-
createRevertCommit
public org.eclipse.jgit.lib.ObjectId createRevertCommit(String message, ChangeNotes notes, CurrentUser user, Timestamp 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:
RestApiException
IOException
-
-