Add support for deleting refs

The internal API will be used by admin, and "ostree refs --delete"
is handy for interactive management.
This commit is contained in:
Colin Walters committed 2013-07-01 15:41:27 -04:00
1 parent 5b3fca8426
commit dc0f3c3dcb
4 files changed
+124 -40

No files matched your search

+6
View File
@@ -44,6 +44,12 @@ assert_not_has_file () {
fi
}
assert_not_file_has_content () {
if grep -q -e "$2" "$1"; then
echo 1>&2 "File '$1' incorrectly matches regexp '$2'"; exit 1
fi
}
assert_file_has_content () {
if ! grep -q -e "$2" "$1"; then
echo 1>&2 "File '$1' doesn't match regexp '$2'"; exit 1
+11 -1
View File
@@ -19,7 +19,7 @@
set -e
echo "1..33"
echo "1..34"
. $(dirname $0)/libtest.sh
@@ -244,3 +244,13 @@ fi
rm repo3 objlist-before-prune objlist-after-prune -rf
echo "ok prune"
cd ${test_tmpdir}
$OSTREE commit -b test3 -s "Another commit" --tree=ref=test2
ostree --repo=repo refs > reflist
assert_file_has_content reflist '^test3$'
ostree --repo=repo refs --delete test3
ostree --repo=repo refs > reflist
assert_not_file_has_content reflist '^test3$'
echo "ok reflist --delete"