@@ -61,11 +61,47 @@ test_expect_success 'nothing to commit' '
61
61
test_must_fail git commit -m initial
62
62
'
63
63
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
+
64
80
test_expect_success ' setup: non-initial commit' '
65
81
echo bongo bongo bongo >file &&
66
82
git commit -m next -a
67
83
'
68
84
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
+
69
105
test_expect_success ' commit message from non-existing file' '
70
106
echo more bongo: bongo bongo bongo bongo >file &&
71
107
test_must_fail git commit -F gah -a
0 commit comments