Skip to content
  • Adam Spiers's avatar
    dir.c: refactor is_path_excluded() · a35341a8
    Adam Spiers authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    In a similar way to the previous commit, this extracts a new helper
    function last_exclude_matching_path() which return the last
    exclude_list element which matched, or NULL if no match was found.
    is_path_excluded() becomes a wrapper around this, and just returns 0
    or 1 depending on whether any matching exclude_list element was found.
    
    This allows callers to find out _why_ a given path was excluded,
    rather than just whether it was or not, paving the way for a new git
    sub-command which allows users to test their exclude lists from the
    command line.
    
    Signed-off-by: default avatarAdam Spiers <git@adamspiers.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a35341a8