commit: Support -F/--body-file, like git

This is more convenient to script for projects which haven't
yet made the leap to using the API.

Closes: https://github.com/ostreedev/ostree/issues/674

Closes: #681
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-02-14 14:15:08 +00:00
1 parent 5a73a366b9
commit 46544f5b4d
2 files changed
+32 -4

No files matched your search

+17 -1
View File
@@ -19,7 +19,7 @@
set -euo pipefail
echo "1..60"
echo "1..61"
$OSTREE checkout test2 checkout-test2
echo "ok checkout"
@@ -115,6 +115,22 @@ omitted_rev=$($OSTREE commit -b test2-no-subject-2 --timestamp="2005-10-29 12:43
assert_streq $empty_rev $omitted_rev
echo "ok commit no subject"
cd ${test_tmpdir}
cat >commitmsg.txt <<EOF
This is a long
commit message.
Build-Host: foo.example.com
Crunchy-With-Extra-Ketchup: true
EOF
$OSTREE commit -b branch-with-commitmsg -F commitmsg.txt -s 'a message' $test_tmpdir/checkout-test2-4
$OSTREE log branch-with-commitmsg > log.txt
assert_file_has_content log.txt '^ *This is a long$'
assert_file_has_content log.txt '^ *Build-Host:.*example.com$'
assert_file_has_content log.txt '^ *Crunchy-With.*true$'
$OSTREE refs --delete branch-with-commitmsg
echo "ok commit body file"
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