diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c index 99687c52..85c4c65d 100644 --- a/src/ostree/ot-builtin-commit.c +++ b/src/ostree/ot-builtin-commit.c @@ -437,13 +437,6 @@ ostree_builtin_commit (int argc, char **argv, GCancellable *cancellable, GError goto out; } - if (!opt_subject) - { - g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "A subject must be specified with --subject"); - goto out; - } - if (!ostree_repo_prepare_transaction (repo, NULL, cancellable, error)) goto out; diff --git a/tests/basic-test.sh b/tests/basic-test.sh index 0373fcbc..93f67f17 100755 --- a/tests/basic-test.sh +++ b/tests/basic-test.sh @@ -19,7 +19,7 @@ set -euo pipefail -echo "1..56" +echo "1..57" $OSTREE checkout test2 checkout-test2 echo "ok checkout" @@ -103,6 +103,12 @@ $OSTREE commit -b test2-no-parent -s '' --parent=none $test_tmpdir/checkout-test assert_streq $($OSTREE log test2-no-parent |grep '^commit' | wc -l) "1" echo "ok commit no parent" +cd ${test_tmpdir} +empty_rev=$($OSTREE commit -b test2-no-subject -s '' --timestamp="2005-10-29 12:43:29 +0000" $test_tmpdir/checkout-test2-4) +omitted_rev=$($OSTREE commit -b test2-no-subject-2 --timestamp="2005-10-29 12:43:29 +0000" $test_tmpdir/checkout-test2-4) +assert_streq $empty_rev $omitted_rev +echo "ok commit no subject" + cd ${test_tmpdir} $OSTREE commit -b test2-custom-parent -s '' $test_tmpdir/checkout-test2-4 $OSTREE commit -b test2-custom-parent -s '' $test_tmpdir/checkout-test2-4