]> 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>
Mon, 22 Sep 2025 21:27:03 +0000 (14:27 -0700)
commit18068139f2d0fc2aa82f34f2c177d781e228e732
tree99e1daf81cad25ffd28df6e406ecc690d89ef371
parentb553332f82440d68710fcfd2dd6718ec5b43f841
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