aboutsummaryrefslogtreecommitdiffstats
path: root/t/t7422-submodule-output.sh
AgeCommit message (Collapse)AuthorFilesLines
2022-11-08submodule--helper: fix a memory leak in "status"Ævar Arnfjörð Bjarmason1-0/+1
The "status" sub-command was leaking the "struct strvec" it was setting up for the reasons explained in f92dbdbc6a8 (revisions API: don't leak memory on argv elements that need free()-ing, 2022-08-02), so let's use the "free_removed_argv_elements" option to setup_revisions() to fix the leak. Even if we did that, clobbering the "diff_files_args.nr" with the return value of setup_revisions() would leave leaks in place, but we can just stop clobbering it. Ever since that code was added in a9f8a37584a (submodule: port submodule subcommand 'status' from shell to C, 2017-10-06) we've had no reason to modify the "nr" member ("argc" at the time): The next use of "diff_files_args" after this is the "strvec_clear()" at the end of the function. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-11-08submodule tests: add tests for top-level flag outputÆvar Arnfjörð Bjarmason1-0/+169
Exhaustively test for how combining various "mixed-level" "git submodule" option works. "Mixed-level" here means options that are accepted by a mixture of the top-level "submodule" command, and e.g. the "status" sub-command. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>