revisions API users: add "goto cleanup" for release_revisions()

Add a release_revisions() to various users of "struct rev_info" which
requires a minor refactoring to a "goto cleanup" pattern to use that
function.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2022-04-13 22:01:40 +02:00
committed by Junio C Hamano
parent 5e480176fe
commit 0139c58ab9
6 changed files with 55 additions and 24 deletions

View File

@ -917,6 +917,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)
cleanup:
strvec_clear(&stash_args);
free_stash_info(&info);
release_revisions(&rev);
if (do_usage)
usage_with_options(git_stash_show_usage, options);
return ret;