blame: remove needless comparison with GIT_SHA1_HEXSZ

When faking a working tree commit, we read in lines from MERGE_HEAD into a strbuf. Because the strbuf is NUL-terminated and get_oid_hex will fail if it unexpectedly encounters a NUL, the check for the length of the line is unnecessary. There is no optimization benefit from this case, either, since on failure we call die. Remove this check, since it is no longer needed. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Aug 18, 2019 at 20:04 UTC fee49308a1a6a3270a52b31275562f3e92f27d0a
1 file changed +1 -1
blame.c
+1 -1
@@ -144,7 +144,7 @@ static void append_merge_parents(struct repository *r,
144
145 while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) {
146 struct object_id oid;
147 - if (line.len < GIT_SHA1_HEXSZ || get_oid_hex(line.buf, &oid))
147 + if (get_oid_hex(line.buf, &oid))
148 die("unknown line in '%s': %s",
149 git_path_merge_head(r), line.buf);
150 tail = append_parent(r, tail, &oid);