From 2c49f7ffb3063fdccccf2a038ab2eee66e7395e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 24 Oct 2016 17:42:22 +0700 Subject: commit: don't be fooled by ita entries when creating initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- t/t2203-add-intent.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't/t2203-add-intent.sh') diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh index 8652a96d86..84a9028c43 100755 --- a/t/t2203-add-intent.sh +++ b/t/t2203-add-intent.sh @@ -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 && ( -- cgit v1.2.3