diff options
author | shejialuo <shejialuo@gmail.com> | 2024-11-20 19:51:08 +0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-11-21 08:21:31 +0900 |
commit | 38cd6eead19f3d7359ebd34cae6f2a37de4ccc10 (patch) | |
tree | 52d04a9c60eb60d62c6371abfbda2d405dbe6028 /builtin/diff-files.c | |
parent | 34b6ce9b30747131b6e781ff718a45328aa887d0 (diff) |
ref: initialize "fsck_ref_report" with zero
In "fsck.c::fsck_refs_error_function", we need to tell whether "oid" and
"referent" is NULL. So, we need to always initialize these parameters to
NULL instead of letting them point to anywhere when creating a new
"fsck_ref_report" structure.
The original code explicitly initializes the "path" member in the
"struct fsck_ref_report" to NULL (which implicitly 0-initializes other
members in the struct). It is more customary to use "{ 0 }" to express
that we are 0-initializing everything. In order to align with the
codebase, initialize "fsck_ref_report" with zero.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff-files.c')
0 files changed, 0 insertions, 0 deletions