CommitValidators: Avoid IOBE when no Change-Id footer is present

Change-Id: Id766ddb3fe87a3a828a4a9d92ae1ebc26323cf51
This commit is contained in:
Dave Borowitz
2016-05-30 09:32:17 -04:00
parent 8458cc2f4e
commit 750a6c1e49

View File

@@ -245,7 +245,7 @@ public class CommitValidators {
String errMsg = String.format( String errMsg = String.format(
MULTIPLE_CHANGE_ID_MSG, sha1); MULTIPLE_CHANGE_ID_MSG, sha1);
throw new CommitValidationException(errMsg, messages); throw new CommitValidationException(errMsg, messages);
} } else {
String v = idList.get(idList.size() - 1).trim(); String v = idList.get(idList.size() - 1).trim();
if (!CHANGE_ID.matcher(v).matches()) { if (!CHANGE_ID.matcher(v).matches()) {
String errMsg = String.format(INVALID_CHANGE_ID_MSG, sha1); String errMsg = String.format(INVALID_CHANGE_ID_MSG, sha1);
@@ -253,6 +253,7 @@ public class CommitValidators {
getMissingChangeIdErrorMsg(errMsg, receiveEvent.commit)); getMissingChangeIdErrorMsg(errMsg, receiveEvent.commit));
throw new CommitValidationException(errMsg, messages); throw new CommitValidationException(errMsg, messages);
} }
}
return Collections.emptyList(); return Collections.emptyList();
} }