Skip to content
  • Jacob Keller's avatar
    refs: loosen restriction on wildcard "*" refspecs · cd377f45
    Jacob Keller authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Loosen restrictions on refspecs by allowing patterns that have a "*"
    within a component instead of only as the whole component.
    
    Remove the logic to accept a single "*" as a whole component from
    check_refname_format(), and implement an extended form of that logic
    in check_refname_component().  Pass the pointer to the flags argument
    to the latter, as it has to clear REFNAME_REFSPEC_PATTERN bit when
    it sees "*".
    
    Teach check_refname_component() function to allow an asterisk "*"
    only when REFNAME_REFSPEC_PATTERN is set in the flags, and drop the
    bit after seeing a "*", to ensure that one side of a refspec
    contains at most one asterisk.
    
    This will allow us to accept refspecs such as `for/bar*:foo/baz*`.
    Any refspec which functioned before shall continue functioning with
    the new logic.
    
    Signed-off-by: default avatarJacob Keller <jacob.keller@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    cd377f45