Merge "Always do Change-Id checks on receiving commits"
This commit is contained in:
@@ -1504,18 +1504,16 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
|
||||
}
|
||||
}
|
||||
|
||||
if (project.isRequireChangeID()) {
|
||||
final List<String> idList = c.getFooterLines(CHANGE_ID);
|
||||
if (idList.isEmpty()) {
|
||||
reject(cmd, "missing Change-Id in commit message ");
|
||||
final List<String> idList = c.getFooterLines(CHANGE_ID);
|
||||
if (idList.isEmpty()) {
|
||||
if (project.isRequireChangeID()) {
|
||||
reject(cmd, "missing Change-Id in commit message");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (idList.size() > 1) {
|
||||
reject(cmd, "multiple Change-Id lines in commit message ");
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if (idList.size() > 1) {
|
||||
reject(cmd, "multiple Change-Id lines in commit message");
|
||||
return false;
|
||||
} else {
|
||||
final String v = idList.get(idList.size() - 1).trim();
|
||||
if (!v.matches("^I[0-9a-f]{8,}.*$")) {
|
||||
reject(cmd, "invalid Change-Id line format in commit message ");
|
||||
|
Reference in New Issue
Block a user