Clean up Change-Id hint text
Before: remote: ERROR: [c3dcb3a] ... remote: remote: Hint: A potential Change-Id was found, but it was not in the footer (last paragraph) of the commit message. remote: After: remote: ERROR: [a1a077b] ... remote: remote: Hint: run remote: git commit --amend remote: and move 'Change-Id: Ixxx..' to the bottom on a separate line Change-Id: I57387d88c7f105a33ede17ef76a4ac1f064fefdd
This commit is contained in:
@@ -338,12 +338,10 @@ public class CommitValidators {
|
||||
if (c.getFullMessage().contains(CHANGE_ID_PREFIX)) {
|
||||
String lastLine = Iterables.getLast(Splitter.on('\n').split(c.getFullMessage()), "");
|
||||
if (!lastLine.contains(CHANGE_ID_PREFIX)) {
|
||||
sb.append('\n');
|
||||
sb.append('\n');
|
||||
sb.append("Hint: A potential ");
|
||||
sb.append(FooterConstants.CHANGE_ID.getName());
|
||||
sb.append(" was found, but it was not in the ");
|
||||
sb.append("footer (last paragraph) of the commit message.");
|
||||
sb.append("\n\n")
|
||||
.append("Hint: run\n")
|
||||
.append(" git commit --amend\n")
|
||||
.append("and move 'Change-Id: Ixxx..' to the bottom on a separate line\n");
|
||||
}
|
||||
}
|
||||
sb.append('\n');
|
||||
|
||||
Reference in New Issue
Block a user