commit: Reject non-regular/non-symlinks earlier with better error message

Also avoid _NOT_SUPPORTED as that triggers the --help behavior from
the commandline; just use _FAILED.

https://bugzilla.gnome.org/show_bug.cgi?id=722410
This commit is contained in:
Colin Walters committed 2014-01-17 10:39:36 -05:00
1 parent b2d0ba7ac1
commit 5034bf3a9d
2 files changed
+29 -2

No files matched your search

+11
View File
@@ -317,3 +317,14 @@ stat '--format=%Y' test2-checkout/baz/cow > cow-mtime
assert_file_has_content cow-mtime 0
echo "ok content mtime"
cd ${test_tmpdir}
rm -rf test2-checkout
mkdir -p test2-checkout
cd test2-checkout
mkfifo afifo
if $OSTREE commit -b test2 -s "Attempt to commit a FIFO" 2>../errmsg; then
assert_not_reached "Committing a FIFO unexpetedly succeeded!"
assert_file_has_content ../errmsg "Unsupported file type"
fi
echo "ok commit of fifo was rejected"