Staging instance, all changes can be removed at any time

Skip to content

cvsclient: handle files which lack a trailing newline

CVS uses \n as a protocol message separator, which forces us to read protocol message line-by-line. File content sent by the server has a length known and is transmitted in bytes. The server appends a final "ok\n" message (or perhaps an error message) when it is done sending file contents.

Properly handle the case where this final message gets buffered along with file contents and is not delimited from file contents by \n because the file lacks a trailing newline. Previously, the final protocol message ended up being written out to file contents in this case.

Found while testing ingestion of the GNU dino CVS repository from cvs.savannah.gnu.org/sources/dino.

Related to #3691


Migrated from D6558 (view on Phabricator)

Merge request reports

Loading