Cleanup CommentsInNotesUtil to read larger notes
The default read limit inside of JGit is usually around 1-5 MiB,
after which the reader will fail to supply content unless the
caller is streaming.
Callers should supply their own maximum sane read limit. Cap it here
at 25 MiB worth of formatted comments per commit on a change. Notes
larger than this will fail to read into a server, stopping unexpected
memory explosion.
Callers that won't modify the data are encouraged to use the faster
getCachedBytes() method, which does not copy before returning.
Insert is overloaded to handle the entire byte array, allowing
the note to be written in one line of code.
Change-Id: Id3b197edb9fddb15d00d62dbe9b6c2b2c08ad9d1
1 file changed