diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-07-18 22:31:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-18 22:31:57 +0200 |
commit | 7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf (patch) | |
tree | 5f4b1b70e19b990092cecc676422042ad12e642a /diff.c | |
parent | Merge branch 'gc/submodule-use-super-prefix' (diff) | |
parent | cocci: generalize "unused" rule to cover more than "strbuf" (diff) | |
download | git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.tar.xz git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.zip |
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, |