Fix panic in git pktline splitter
This bug was discovered during work on !844 (merged)
Within the Git pkt-line format, there are four special empty packets: 0000
, 0001
, 0002
, 0003
. Of these four our splitter only handled 0000
correctly. The others would lead to a slice out of bounds panic. This change fixes that so that none of the four special packets blows up the parser.
Because we had more than one pkt-line parser, this change also factors out the parser into a package so we can reuse it.
Edited by GitLab Release Tools Bot