aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-07 08:38:30 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-07 10:30:51 -0700
commit724b6d1e18606ca2fa14d7cc48c3bf3884363e25 (patch)
tree694040d437a625fbd1e37e4f4b6f44dccfeff2e0 /builtin/commit.c
parentident: add casts for fallback name and GECOS (diff)
downloadgit-724b6d1e18606ca2fa14d7cc48c3bf3884363e25.tar.gz
git-724b6d1e18606ca2fa14d7cc48c3bf3884363e25.zip
object-file: mark cached object buffers as const
The buffers of cached objects are never modified, but are still stored as a non-constant pointer. This will cause a compiler warning once we enable the `-Wwrite-strings` compiler warning as we assign an empty constant string when initializing the static `empty_tree` cached object. Convert the field to be constant. This requires us to shuffle around the code a bit because we memcpy(3P) into the allocated buffer in `pretend_object_file()`. This is easily fixed though by allocating the buffer into a temporary variable first. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions