@@ -61,11 +61,47 @@ test_expect_success 'nothing to commit' '
6161 test_must_fail git commit -m initial
6262'
6363
64+ test_expect_success ' --dry-run fails with nothing to commit' '
65+ test_must_fail git commit -m initial --dry-run
66+ '
67+
68+ test_expect_success ' --short fails with nothing to commit' '
69+ test_must_fail git commit -m initial --short
70+ '
71+
72+ test_expect_success ' --porcelain fails with nothing to commit' '
73+ test_must_fail git commit -m initial --porcelain
74+ '
75+
76+ test_expect_success ' --long fails with nothing to commit' '
77+ test_must_fail git commit -m initial --long
78+ '
79+
6480test_expect_success ' setup: non-initial commit' '
6581 echo bongo bongo bongo >file &&
6682 git commit -m next -a
6783'
6884
85+ test_expect_success ' --dry-run with stuff to commit returns ok' '
86+ echo bongo bongo bongo >>file &&
87+ git commit -m next -a --dry-run
88+ '
89+
90+ test_expect_failure ' --short with stuff to commit returns ok' '
91+ echo bongo bongo bongo >>file &&
92+ git commit -m next -a --short
93+ '
94+
95+ test_expect_failure ' --porcelain with stuff to commit returns ok' '
96+ echo bongo bongo bongo >>file &&
97+ git commit -m next -a --porcelain
98+ '
99+
100+ test_expect_success ' --long with stuff to commit returns ok' '
101+ echo bongo bongo bongo >>file &&
102+ git commit -m next -a --long
103+ '
104+
69105test_expect_success ' commit message from non-existing file' '
70106 echo more bongo: bongo bongo bongo bongo >file &&
71107 test_must_fail git commit -F gah -a
0 commit comments