Skip to content
  • Linus Torvalds's avatar
    Make git-add behave more sensibly in a case-insensitive environment · 1102952b
    Linus Torvalds authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    This expands on the previous patch, and allows "git add" to sanely handle
    a filename that has changed case, keeping the case in the index constant,
    and avoiding aliases.
    
    In particular, if you have an index entry called "File", but the
    checked-out tree is case-corrupted and has an entry called "file"
    instead, doing a
    
    	git add .
    
    (or naming "file" explicitly) will automatically notice that we have an
    alias, and will replace the name "file" with the existing index
    capitalization (ie "File").
    
    However, if we actually have *both* a file called "File" and one called
    "file", and they don't have the same lstat() information (ie we're on a
    case-sensitive filesystem but have the "core.ignorecase" flag set), we
    will error out if we try to add them both.
    
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    1102952b