Skip to content

Commit d6d1a75

Browse files
peffgitster
authored andcommitted
pkt-line: tighten sideband PACK check when tracing
To find the start of the pack data, we accept the word PACK at the beginning of any sideband channel, even though what we really want is to find the pack data on channel 1. In practice this doesn't matter, as sideband-2 messages tend to start with "error:" or similar, but it is a good idea to be explicit (especially as we add more code in this area, we will rely on this assumption). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f3612ac commit d6d1a75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkt-line.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static void packet_trace(const char *buf, unsigned int len, int write)
2424
strbuf_addf(&out, "packet: %12s%c ",
2525
packet_trace_prefix, write ? '>' : '<');
2626

27-
if (starts_with(buf, "PACK") || starts_with(buf + 1, "PACK")) {
27+
if (starts_with(buf, "PACK") || starts_with(buf, "\1PACK")) {
2828
strbuf_addstr(&out, "PACK ...");
2929
trace_disable(&trace_packet);
3030
}

0 commit comments

Comments
 (0)