Please sign in to comment.
patch-id.c: use strbuf instead of a fixed buffer
get_one_patchid() uses a rather dumb heuristic to determine if the passed buffer is part of the next commit. Whenever the first 40 bytes are a valid hexadecimal sha1 representation, get_one_patchid() returns next_sha1. Once the current line is longer than the fixed buffer, this will break (provided the additional bytes make a valid hexadecimal sha1). As a result patch-id returns incorrect results. Instead, use strbuf and read one line at a time. Helped-by: Jeff King <firstname.lastname@example.org> Signed-off-by: Michael Schubert <email@example.com> Signed-off-by: Junio C Hamano <firstname.lastname@example.org>
- Loading branch information...