]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/cocci-unused'
authorJunio C Hamano <gitster@pobox.com>
Mon, 18 Jul 2022 20:31:56 +0000 (13:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Jul 2022 20:31:57 +0000 (13:31 -0700)
Add Coccinelle rules to detect the pattern of initializing and then
finalizing a structure without using it in between at all, which
happens after code restructuring and the compilers fail to
recognize as an unused variable.

* ab/cocci-unused:
  cocci: generalize "unused" rule to cover more than "strbuf"
  cocci: add and apply a rule to find "unused" strbufs
  cocci: have "coccicheck{,-pending}" depend on "coccicheck-test"
  cocci: add a "coccicheck-test" target and test *.cocci rules
  Makefile & .gitignore: ignore & clean "git.res", not "*.res"
  Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS

1  2 
Makefile
builtin/fetch.c
diff.c

diff --cc Makefile
Simple merge
diff --cc builtin/fetch.c
index b019004c1b21a098ca2a86a58f1f279871508ea7,8a3ae71fed0550c706c60e6c0b1d68d1323b9af1..fc5cecb48356ffccd4251670bd779d52ab3d392c
@@@ -1106,10 -1110,10 +1106,10 @@@ N_("it took %.2f seconds to check force
  static int store_updated_refs(const char *raw_url, const char *remote_name,
                              int connectivity_checked,
                              struct ref_transaction *transaction, struct ref *ref_map,
 -                            struct fetch_head *fetch_head, struct worktree **worktrees)
 +                            struct fetch_head *fetch_head)
  {
        int url_len, i, rc = 0;
-       struct strbuf note = STRBUF_INIT, err = STRBUF_INIT;
+       struct strbuf note = STRBUF_INIT;
        const char *what, *kind;
        struct ref *rm;
        char *url;
diff --cc diff.c
Simple merge