diffcore-rename: avoid usage of global in too_many_rename_candidates()
authorElijah Newren <newren@gmail.com>
Fri, 11 Dec 2020 09:08:41 +0000 (09:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Dec 2020 17:34:50 +0000 (09:34 -0800)
commit00b8cccdd83c6f8c9ffefd133b291dadf8e788d7
tree162f45d52c7b69faa64bfa24ffb2776488c128a3
parent26a66a6b1c653bc6c05534016992985d48267d70
diffcore-rename: avoid usage of global in too_many_rename_candidates()

too_many_rename_candidates() got the number of rename destinations via
an argument to the function, but the number of rename sources via a
global variable.  That felt rather inconsistent.  Pass in the number of
rename sources as an argument as well.

While we are at it... We had a local variable, num_src, that served two
purposes.  Initially it was set to the global value, but later was used
for counting a subset of the number of sources.  Since we now have a
function argument for the former usage, introduce a clearer variable
name for the latter usage.

This patch has no behavioral changes; it's just renaming and passing an
argument instead of grabbing it from the global namespace.  (You may
find it easier to view the patch using git diff's --color-words option.)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-rename.c