Package com.google.gerrit.server.util
Class CommitMessageUtil
java.lang.Object
com.google.gerrit.server.util.CommitMessageUtil
Utility functions to manipulate commit messages.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcheckAndSanitizeCommitMessage(String commitMessage) Checks for invalid (empty or containing \0) commit messages and appends a newline character to the commit message.static org.eclipse.jgit.lib.ObjectIdstatic Change.KeygetChangeIdFromCommitMessageFooter(String commitMessage) Return the value of Change-Id from the commit message footer.static StringgetChangeIdFromObjectId(org.eclipse.jgit.lib.ObjectId objectId)
-
Method Details
-
checkAndSanitizeCommitMessage
Checks for invalid (empty or containing \0) commit messages and appends a newline character to the commit message.- Returns:
- the trimmed message with a trailing newline character
- Throws:
BadRequestException- if the commit message is null or empty
-
generateChangeId
public static org.eclipse.jgit.lib.ObjectId generateChangeId() -
generateKey
-
getChangeIdFromObjectId
-