diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Trim the comments and dead code across the tree
Diffstat (limited to '')
-rw-r--r--source/parsing.c11
1 file changed, 3 insertions, 8 deletions
diff --git a/source/parsing.c b/source/parsing.c
index de2798a..745bbba 100644
--- a/source/parsing.c
+++ b/source/parsing.c
@@ -77,9 +77,6 @@ static const char *reencode(char **text, const char *from, const char *to)
{
char *converted;
- if (!text)
- return NULL;
-
if (!*text || !from || !to)
return *text;
@@ -160,7 +157,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
while (skip_prefix(p, "parent ", &p))
p += the_hash_algo->hexsz + 1;
- if (p && skip_prefix(p, "author ", &p)) {
+ if (skip_prefix(p, "author ", &p)) {
parse_user(p, &info->author, &info->author_email,
&info->author_date, &info->author_tz);
p = next_header_line(p);
@@ -197,10 +194,8 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
eol++;
info->msg = xstrdup(eol);
} else {
- // Reached when an object is truncated mid header, which
- // leaves nothing at all after them. Callers render subject
- // and msg as text without checking, so they get empty
- // strings rather than NULL.
+ // An object truncated mid header leaves nothing after it,
+ // and callers render subject and msg without NULL checks.
info->subject = xstrdup("");
info->msg = xstrdup("");
}