Skip to content
  • Taylor Blau's avatar
    ref-filter.c: pass empty-string as NULL to atom parsers · bea4dbea
    Taylor Blau authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Peff points out that different atom parsers handle the empty
    "sub-argument" list differently. An example of this is the format
    "%(refname:)".
    
    Since callers often use `string_list_split` (which splits the empty
    string with any delimiter as a 1-ary string_list containing the empty
    string), this makes handling empty sub-argument strings non-ergonomic.
    
    Let's fix this by declaring that atom parser implementations must
    not care about distinguishing between the empty string "%(refname:)"
    and no sub-arguments "%(refname)".  Current code aborts, either with
    "unrecognised arg" (e.g. "refname:") or "does not take args"
    (e.g. "body:") as an error message.
    
    Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
    Reviewed-by: default avatarJeff King <peff@peff.net>
    Reviewed-by: default avatarJonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    bea4dbea