]> git.ipfire.org Git - thirdparty/git.git/commit
pickaxe: refactor function selection in diffcore-pickaxe()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 12 Apr 2021 17:15:19 +0000 (19:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 May 2021 03:47:31 +0000 (12:47 +0900)
commit03c1f14acf5169d8e6c06a60c28ee5a6cfb9fd54
treee5b7b3b1c08f6d898e8d65582bb5bb0fc16f6d79
parentd90d441c336cc120b47e025d14c3879864ce60c5
pickaxe: refactor function selection in diffcore-pickaxe()

It's hard to read this codepath at a glance and reason about exactly
what combination of -G and -S will compile either regexes or kwset,
and whether we'll then dispatch to "diff_grep" or "has_changes".

Then in the "--find-object" case we aren't using the callback
function, but were previously passing down "has_changes".

Refactor this code to exhaustively check "opts", it's now more obvious
what callback function (or none) we want under what mode.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-pickaxe.c