bin/refs: Disallow creating broken aliases

This is the alias version of #1749. I.e. we want to make sure that one
can't even create an alias which would end up dangling.

See also: https://pagure.io/releng/issue/7891

Closes: #1768
Approved by: sinnykumari
This commit is contained in:
Jonathan Lebon authored and Atomic Bot committed 2018-10-31 12:32:30 +00:00
1 parent 51752baf0e
commit 34a8867749
2 files changed
+10 -1

No files matched your search

+7 -1
View File
@@ -25,7 +25,7 @@ set -euo pipefail
setup_fake_remote_repo1 "archive"
echo '1..6'
echo '1..7'
cd ${test_tmpdir}
mkdir repo
@@ -207,3 +207,9 @@ if ${CMD_PREFIX} ostree --repo=repo refs -A exampleos/x86_64/27/server --create=
fi
assert_file_has_content_literal err.txt 'Cannot create alias to remote ref'
echo "ok ref no alias remote"
if ${CMD_PREFIX} ostree --repo=repo refs -A --create foobar nonexistent 2>err.txt; then
fatal "Created alias to nonexistent ref?"
fi
assert_file_has_content_literal err.txt 'Cannot create alias to non-existent ref'
echo "ok ref no broken alias"