In the test 'using invalid commit with -C' git-commit would have failed
even if the -C option  had been given the correct commit, as there was
nothing to commit. Fix it by making sure there is always something to
commit and git-commit fails because of the invalid commit provided to

Signed-off-by: Kacper Kornet <>
 t/ | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/ b/t/
index 99ce36f..699a603 100755
--- a/t/
+++ b/t/
@@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with --interactive' '
 test_expect_success 'using invalid commit with -C' '
-       test_must_fail git commit -C bogus
+       echo bong >file &&
+       git add file &&
+       test_must_fail git commit -C bogus &&
+       git reset
 test_expect_success 'nothing to commit' '

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to