]> git.ipfire.org Git - thirdparty/git.git/commit
submodule--helper: drop unused argc from module_list_compute()
authorJeff King <peff@peff.net>
Tue, 18 Oct 2022 01:02:02 +0000 (21:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Oct 2022 04:24:03 +0000 (21:24 -0700)
commit70aa1d7576830c5efa93953ccded77deb0d7eb25
tree394f5a109062ae75d179ee305d6981f2bc9d9111
parent0e5a87e0422ff308641199d1afe94b58e1249bc0
submodule--helper: drop unused argc from module_list_compute()

The module_list_compute() function takes an argc/argv pair, but never
looks at argc. This is OK, as the NULL terminator in argv is sufficient
for our purposes (we feed it to parse_pathspec(), which takes only the
array, not a count).

Note that one of the callers _looks_ like it would be buggy, but isn't:
we pass 0/NULL for argc/argv from module_foreach(), so finding the
terminating NULL in that argv naively would segfault. However,
parse_pathspec() is smart enough to interpret a bare NULL as an empty
argv.

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