Skip to content
  • Jeff King's avatar
    add-interactive: handle deletion of empty files · 24ab81ae
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Usually we show deletion as a big hunk deleting all of the
    file's text. However, for files with no content, the diff
    shows just the 'deleted file mode ...' line. This patch
    cause "add -p" (and related commands) to recognize that line
    and explicitly ask about deleting the file.
    
    We only add the "stage this deletion" hunk for empty files,
    since other files will already ask about the big content
    deletion hunk. We could also change those files to simply
    display "stage this deletion", but showing the actual
    deleted content is probably what an interactive user wants.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    24ab81ae