commit: don't be fooled by ita entries when creating initial commit
ita entries are dropped at tree generation phase. If the entire index consists of just ita entries, the result would be a a commit with no entries, which should be caught unless --allow-empty is specified. The test "!!active_nr" is not sufficient to catch this. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
018ec3c820
commit
2c49f7ffb3
@ -129,6 +129,16 @@ test_expect_success 'cache-tree does skip dir that becomes empty' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'commit: ita entries ignored in empty intial commit check' '
|
||||
git init empty-intial-commit &&
|
||||
(
|
||||
cd empty-intial-commit &&
|
||||
: >one &&
|
||||
git add -N one &&
|
||||
test_must_fail git commit -m nothing-new-here
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'commit: ita entries ignored in empty commit check' '
|
||||
git init empty-subsequent-commit &&
|
||||
(
|
||||
|
Reference in New Issue
Block a user