From: Junio C Hamano Date: Mon, 18 Jul 2022 20:31:56 +0000 (-0700) Subject: Merge branch 'ab/cocci-unused' X-Git-Tag: v2.38.0-rc0~149 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf;p=thirdparty%2Fgit.git Merge branch 'ab/cocci-unused' 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 --- 7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf diff --cc builtin/fetch.c index b019004c1b,8a3ae71fed..fc5cecb483 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@@ -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;