mv: replace src_dir with a strvec
commit64f8502b40affcb4c956c511fef7e704a88b0e25
authorJeff King <peff@peff.net>
Thu, 30 May 2024 06:46:38 +0000 (30 02:46 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 May 2024 15:55:29 +0000 (30 08:55 -0700)
tree72837aa27b50c7a1457b59d0e2ae64e89686e40c
parentd58a687705d3920464c786b4f7b837d620f8d8b1
mv: replace src_dir with a strvec

We manually manage the src_dir array with ALLOC_GROW. Using a strvec is
a little more ergonomic, and makes the memory ownership more clear. It
does mean that we copy the strings (which were otherwise just pointers
into the "sources" strvec), but using the same rationale as 9fcd9e4e72
(builtin/mv duplicate string list memory, 2024-05-27), it's just not
enough to be worth worrying about here.

As a bonus, this gets rid of some "int"s used for allocation management
(though in practice these were limited to command-line sizes and thus
not overflowable).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mv.c