]> git.ipfire.org Git - thirdparty/git.git/commit
cocci: add and apply free_commit_list() rules
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 13 Apr 2022 20:01:34 +0000 (22:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Apr 2022 06:56:08 +0000 (23:56 -0700)
commitbf20fe4ca8c8d2ba2087c9c44b4ee09a1d1467ed
tree08636c2ac7c428086e6ad0324f4f7d7703e82e86
parent89f45cf4eb031f28b5dd028983734c4ddfa99439
cocci: add and apply free_commit_list() rules

Add and apply coccinelle rules to remove "if (E)" before
"free_commit_list(E)", the function can accept NULL, and further
change cases where "E = NULL" followed to also be unconditionally.

The code changes in this commit were entirely made by the coccinelle
rule being added here, and applied with:

    make contrib/coccinelle/free.cocci.patch
    patch -p1 <contrib/coccinelle/free.cocci.patch

The only manual intervention here is that the the relevant code in
commit.c has been manually re-indented.

Suggested-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-list.c
commit.c
contrib/coccinelle/free.cocci
revision.c
submodule.c