diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-07-18 13:31:56 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-18 13:31:57 -0700 |
commit | 7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf (patch) | |
tree | 5f4b1b70e19b990092cecc676422042ad12e642a /diff.c | |
parent | 6d003858e5cb82a4ac1892fa6c02604b0aa27fba (diff) | |
parent | 06f5f8940c0335f2a5b0a7bbd086115f4659eaa8 (diff) | |
download | git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.tar.gz |
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
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -1289,7 +1289,6 @@ static void emit_diff_symbol_from_struct(struct diff_options *o, { static const char *nneof = " No newline at end of file\n"; const char *context, *reset, *set, *set_sign, *meta, *fraginfo; - struct strbuf sb = STRBUF_INIT; enum diff_symbol s = eds->s; const char *line = eds->line; @@ -1521,7 +1520,6 @@ static void emit_diff_symbol_from_struct(struct diff_options *o, default: BUG("unknown diff symbol"); } - strbuf_release(&sb); } static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s, |