diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-04-13 23:01:38 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-14 09:56:08 +0300 |
commit | f196c1e908db9242206e1fc9c64f33baf92676bb (patch) | |
tree | 9cd60bdf5437d0aa3037d32cbecdc12946713a9f /submodule.c | |
parent | 296a1438455d366475570ac49afb466f591417dc (diff) |
revisions API users: use release_revisions() needing REV_INFO_INIT
Use release_revisions() to various users of "struct rev_list" which
need to have their "struct rev_info" zero-initialized before we can
start using it.
For the bundle.c code see the early exit case added in
3bbbe467f29 (bundle verify: error out if called without an object
database, 2019-05-27).
For the relevant bisect.c code see 45b6370812c (bisect: libify
`check_good_are_ancestors_of_bad` and its dependents, 2020-02-17).
For the submodule.c code see the "goto" on "(!left || !right || !sub)"
added in 8e6df65015f (submodule: refactor show_submodule_summary with
helper function, 2016-08-31).
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c index 86ebd3f35c..e9c320d16d 100644 --- a/submodule.c +++ b/submodule.c @@ -638,7 +638,7 @@ void show_submodule_diff_summary(struct diff_options *o, const char *path, struct object_id *one, struct object_id *two, unsigned dirty_submodule) { - struct rev_info rev; + struct rev_info rev = REV_INFO_INIT; struct commit *left = NULL, *right = NULL; struct commit_list *merge_bases = NULL; struct repository *sub; @@ -665,6 +665,7 @@ void show_submodule_diff_summary(struct diff_options *o, const char *path, out: free_commit_list(merge_bases); + release_revisions(&rev); clear_commit_marks(left, ~0); clear_commit_marks(right, ~0); if (sub) { |