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);
|
||||||
final List<String> idList = c.getFooterLines(CHANGE_ID);
|
if (idList.isEmpty()) {
|
||||||
if (idList.isEmpty()) {
|
if (project.isRequireChangeID()) {
|
||||||
reject(cmd, "missing Change-Id in commit message ");
|
reject(cmd, "missing Change-Id in commit message");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (idList.size() > 1) {
|
||||||
if (idList.size() > 1) {
|
reject(cmd, "multiple Change-Id lines in commit message");
|
||||||
reject(cmd, "multiple Change-Id lines in commit message ");
|
return false;
|
||||||
return false;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
final String v = idList.get(idList.size() - 1).trim();
|
final String v = idList.get(idList.size() - 1).trim();
|
||||||
if (!v.matches("^I[0-9a-f]{8,}.*$")) {
|
if (!v.matches("^I[0-9a-f]{8,}.*$")) {
|
||||||
reject(cmd, "invalid Change-Id line format in commit message ");
|
reject(cmd, "invalid Change-Id line format in commit message ");
|
||||||
|
Reference in New Issue
Block a user