]> git.ipfire.org Git - thirdparty/git.git/commit
range-diff: drop useless "offset" variable from read_patches()
authorJeff King <peff@peff.net>
Mon, 9 Aug 2021 22:47:42 +0000 (18:47 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Aug 2021 18:37:36 +0000 (11:37 -0700)
commit47ac23d31483fa8f942117fa5e0c0a70572e9e59
tree1550bdcd31ae1559e5b7f1aa163c176e6ca264d0
parentebf3c04b262aa27fbb97f8a0156c2347fecafafb
range-diff: drop useless "offset" variable from read_patches()

The "offset" variable was was introduced in 44b67cb62b (range-diff:
split lines manually, 2019-07-11), but it has never done anything
useful. We use it to count up the number of bytes we've consumed, but we
never look at the result. It was probably copied accidentally from an
almost-identical loop in apply.c:find_header() (and the point of that
commit was to make use of the parse_git_diff_header() function which
underlies both).

Because the variable was set but not used, most compilers didn't seem to
notice, but the upcoming clang-14 does complain about it, via its
-Wunused-but-set-variable warning.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
range-diff.c