summaryrefslogtreecommitdiff
path: root/t/t2203-add-intent.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-10-24 10:42:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-24 17:54:11 (GMT)
commit2c49f7ffb3063fdccccf2a038ab2eee66e7395e4 (patch)
treef4102aab046ebef724d75da52dbb52008c5cd3f1 /t/t2203-add-intent.sh
parent018ec3c8203ad1aee683840a580cfba7914419b6 (diff)
downloadgit-2c49f7ffb3063fdccccf2a038ab2eee66e7395e4.zip
git-2c49f7ffb3063fdccccf2a038ab2eee66e7395e4.tar.gz
git-2c49f7ffb3063fdccccf2a038ab2eee66e7395e4.tar.bz2
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>
Diffstat (limited to 't/t2203-add-intent.sh')
-rwxr-xr-xt/t2203-add-intent.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index 8652a96..84a9028 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 &&
(