• Junio C Hamano's avatar
    git add --intent-to-add: fix removal of cached emptiness · 388b2acd
    Junio C Hamano authored
    This uses the extended index flag mechanism introduced earlier to mark
    the entries added to the index via "git add -N" with CE_INTENT_TO_ADD.
    The logic to detect an "intent to add" entry for the purpose of allowing
    "git rm --cached $path" is tightened to check not just for a staged empty
    blob, but with the CE_INTENT_TO_ADD bit.  This protects an empty blob that
    was explicitly added and then modified in the work tree from being dropped
    with this sequence:
    	$ >empty
    	$ git add empty
    	$ echo "non empty" >empty
    	$ git rm --cached empty
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
builtin-rm.c 7 KB