Skip to content
  • Simon Ruderich's avatar
    diffcore-pickaxe: remove unnecessary call to get_textconv() · bc615898
    Simon Ruderich authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The fill_one() function is responsible for finding and filling the
    textconv filter as necessary, and is called by diff_grep() function
    that implements "git log -G<pattern>".
    
    The has_changes() function that implements "git log -S<block>" calls
    get_textconv() for two sides being compared, before it checks to see
    if it was asked to perform the pickaxe limiting.  Move the code
    around to avoid this wastage.
    
    After has_changes() calls get_textconv() to obtain textconv for both
    sides, fill_one() is called to use them.
    
    By adding get_textconv() to diff_grep() and relieving fill_one() of
    responsibility to find the textconv filter, we can avoid calling
    get_textconv() twice in has_changes().
    
    With this change it's also no longer necessary for fill_one() to
    modify the textconv argument, therefore pass a pointer instead of a
    pointer to a pointer.
    
    Signed-off-by: default avatarSimon Ruderich <simon@ruderich.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    bc615898