• Jeff King's avatar
    diffcore-pickaxe: unify code for log -S/-G · 61690bf4
    Jeff King authored
    The logic flow of has_changes() used for "log -S" and diff_grep()
    used for "log -G" are essentially the same.  See if we have both
    sides that could be different in any interesting way, slurp the
    contents in core, possibly after applying textconv, inspect the
    contents, clean-up and report the result.  The only difference
    between the two is how "inspect" step works.
    
    Unify this codeflow in a helper, pickaxe_match(), which takes a
    callback function that implements the specific "inspect" step.
    
    After removing the common scaffolding code from the existing
    has_changes() and diff_grep(), they each becomes such a callback
    function suitable for passing to pickaxe_match().
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    61690bf4
diffcore-pickaxe.c 6.47 KB