summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-27 13:47:09 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-27 11:20:02 -0700
commit3d231f7b8236787252cb336878e3ace75c1df545 (patch)
tree1036a446d15bc320dd6d6ed1669362ceab2bd0d8 /builtin/commit.c
parent11ce77b5cc04e2a42b98f0f9f42d367f50f3b1fc (diff)
builtin/mv: refactor `add_slash()` to always return allocated strings
The `add_slash()` function will only conditionally return an allocated string when the passed-in string did not yet have a trailing slash. This makes the memory ownership harder to track than really necessary. It's dubious whether this optimization really buys us all that much. The number of times we execute this function is bounded by the number of arguments to git-mv(1), so in the typical case we may end up saving an allocation or two. Simplify the code to unconditionally return allocated strings. 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