diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-20 22:26:59 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-20 22:26:59 (GMT) |
commit | 538dc459a0331c48b893c9f6ca0be5917860bb99 (patch) | |
tree | d8b7cf10c62573f767116c14f7ffd0d9e1d8ec32 /builtin/tag.c | |
parent | acdeb10f91da939135fbacb847792ae237450d7d (diff) | |
parent | 72a4ea71e5f29e4078363e87e4471128ff713a62 (diff) | |
download | git-538dc459a0331c48b893c9f6ca0be5917860bb99.zip git-538dc459a0331c48b893c9f6ca0be5917860bb99.tar.gz git-538dc459a0331c48b893c9f6ca0be5917860bb99.tar.bz2 |
Merge branch 'ep/maint-equals-null-cocci'
Introduce and apply coccinelle rule to discourage an explicit
comparison between a pointer and NULL, and applies the clean-up to
the maintenance track.
* ep/maint-equals-null-cocci:
tree-wide: apply equals-null.cocci
tree-wide: apply equals-null.cocci
contrib/coccinnelle: add equals-null.cocci
Diffstat (limited to 'builtin/tag.c')
-rw-r--r-- | builtin/tag.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/tag.c b/builtin/tag.c index e5a8f85..75dece0 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -364,7 +364,7 @@ static void create_reflog_msg(const struct object_id *oid, struct strbuf *sb) strbuf_addstr(sb, "object of unknown type"); break; case OBJ_COMMIT: - if ((buf = read_object_file(oid, &type, &size)) != NULL) { + if ((buf = read_object_file(oid, &type, &size))) { subject_len = find_commit_subject(buf, &subject_start); strbuf_insert(sb, sb->len, subject_start, subject_len); } else { @@ -372,7 +372,7 @@ static void create_reflog_msg(const struct object_id *oid, struct strbuf *sb) } free(buf); - if ((c = lookup_commit_reference(the_repository, oid)) != NULL) + if ((c = lookup_commit_reference(the_repository, oid))) strbuf_addf(sb, ", %s", show_date(c->date, 0, DATE_MODE(SHORT))); break; case OBJ_TREE: |