commit: fix empty commit creation when there's no changes but ita entries
commit018ec3c8203ad1aee683840a580cfba7914419b6
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Mon, 24 Oct 2016 10:42:21 +0000 (24 17:42 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Oct 2016 17:48:23 +0000 (24 10:48 -0700)
treef25dff29fb2c25a2c7ee70f410a94c4eef941393
parentb42b45191950a4ac39f6f5ae042c15ad114da79b
commit: fix empty commit creation when there's no changes but ita entries

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
commit.

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: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
diff-lib.c
diff.h
sequencer.c
t/t2203-add-intent.sh