Skip to content
  • Michael J Gruber's avatar
    add: ignore only ignored files · 1d31e5a2
    Michael J Gruber authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    "git add foo bar" adds neither foo nor bar when bar is ignored, but dies
    to let the user recheck their command invocation. This becomes less
    helpful when "git add foo.*" is subject to shell expansion and some of
    the expanded files are ignored.
    
    "git add --ignore-errors" is supposed to ignore errors when indexing
    some files and adds the others. It does ignore errors from actual
    indexing attempts, but does not ignore the error "file is ignored" as
    outlined above. This is unexpected.
    
    Change "git add foo bar" to add foo when bar is ignored, but issue
    a warning and return a failure code as before the change.
    
    That is, in the case of trying to add ignored files we now act the same
    way (with or without "--ignore-errors") in which we act for more
    severe indexing errors when "--ignore-errors" is specified.
    
    Signed-off-by: default avatarMichael J Gruber <git@drmicha.warpmail.net>
    Reviewed-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    1d31e5a2