Expand description
The command list: <old-oid> <new-oid> <refname>, written by the client
and read by the server.
§Reference names are bytes
refs/heads/\xff is a name git will create, advertise and serve, so
PushCommand::name is a BString and parse_line splits on bytes.
Routing the line through String::from_utf8_lossy first — which is what a
String field forces — replaces every invalid byte with U+FFFD before the
name is validated. A non-UTF-8 name is then accepted and stored under a name
the client never asked for, and any two names differing only in their invalid
bytes collapse onto the same reference, so a push to one silently overwrites
the other. That was a real bug in gunnar’s server. The lossy rendering
survives only in the error messages here, where it is read by a human and
not by a store.
Structs§
- Push
Command - One line of the command list: move
namefromoldtonew.
Constants§
- SHALLOW_
PREFIX - A
shallow <oid>line, which a shallow client sends before its commands and which is not a command.
Functions§
- lines
- Render the command list as payload lines, without pkt-line framing, without the terminating flush-pkt and without the trailing newline: the caller owns the framer.
- parse_
line - Parse one command line, having already had its capability suffix removed by
capabilities::split. - push_
option_ lines - Render the push-options section as payload lines.