• Duy Nguyen's avatar
    commit: fix empty commit creation when there's no changes but ita entries · 018ec3c8
    Duy Nguyen authored
    If i-t-a entries are present and there is no change between the index
    and HEAD i-t-a entries, index_differs_from() still returns "dirty, new
    entries" (aka, the resulting commit is not empty), but cache-tree will
    skip i-t-a entries and produce the exact same tree of current
    index_differs_from() is supposed to catch this so we can abort
    git-commit (unless --no-empty is specified). Update it to optionally
    ignore i-t-a entries when doing a diff between the index and HEAD so
    that it would return "no change" in this case and abort commit.
    Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
diff-lib.c 14.6 KB