]> git.ipfire.org Git - thirdparty/git.git/commit
treewide: pass strvecs around for setup_revisions_from_strvec()
authorJeff King <peff@peff.net>
Fri, 19 Sep 2025 22:50:48 +0000 (18:50 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 21 Sep 2025 20:47:31 +0000 (13:47 -0700)
commitb917fac3627dfc12e00f89390026a1206981fc89
tree959e60782a1018c92d67422c5686a2b59218a13e
parent7c416e4155bc3a3d4f0ec6643a3648bd9a278779
treewide: pass strvecs around for setup_revisions_from_strvec()

The previous commit converted callers of setup_revisions() with a strvec
to use the safer and easier _from_strvec() variant.

Let's now convert spots that don't directly have a strvec, but receive
an argc/argv pair that eventually comes from one. We'll instead pass the
strvec down to the point where we call setup_revisions().

That makes these functions slightly less flexible if they were to grow
other callers that don't use strvecs, but this rigidity is buying us
some safety. It is only safe to pass the free_removed_argv_elements
option to setup_revisions() if we know the elements of argv/argc are
allocated on the heap. That isn't communicated in the type system when
we are passed the bare elements. But if we get a strvec, we know that
the elements are allocated strings.

And at any rate, each of these modified functions has only a single
caller (that has a strvec), so the loss of flexibility is unlikely to
ever matter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
builtin/rebase.c
sequencer.c
sequencer.h
shallow.c
shallow.h
upload-pack.c