summaryrefslogtreecommitdiff
path: root/blame.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 20:04:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-19 22:04:57 (GMT)
commitfee49308a1a6a3270a52b31275562f3e92f27d0a (patch)
treea154cb6e825f2168b17e097138bcbbc1f8f4d854 /blame.c
parent7e0d029f187dfe3fee9de9ccce43200202fc14f6 (diff)
downloadgit-fee49308a1a6a3270a52b31275562f3e92f27d0a.zip
git-fee49308a1a6a3270a52b31275562f3e92f27d0a.tar.gz
git-fee49308a1a6a3270a52b31275562f3e92f27d0a.tar.bz2
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>
Diffstat (limited to 'blame.c')
-rw-r--r--blame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blame.c b/blame.c
index 36a2e7e..6596d8d 100644
--- a/blame.c
+++ b/blame.c
@@ -144,7 +144,7 @@ static void append_merge_parents(struct repository *r,
while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) {
struct object_id oid;
- if (line.len < GIT_SHA1_HEXSZ || get_oid_hex(line.buf, &oid))
+ if (get_oid_hex(line.buf, &oid))
die("unknown line in '%s': %s",
git_path_merge_head(r), line.buf);
tail = append_parent(r, tail, &oid);