commit: Drop the ability to --add --remove
This forces us to have two code paths for doing a commit; let's just drop this ability for now since it's not very useful.
This commit is contained in:
1 parent
1ba3a67eb5
commit
2be1407622
3 files changed
+57
-94
No files matched your search
+21
-16
@@ -63,12 +63,28 @@ setup_test_repository () {
|
||||
|
||||
oldpwd=`pwd`
|
||||
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo
|
||||
cd repo
|
||||
ot_repo="--repo=`pwd`"
|
||||
export OSTREE="ostree ${ot_repo}"
|
||||
if test "$mode" = "archive"; then
|
||||
$OSTREE init --archive
|
||||
else
|
||||
$OSTREE init
|
||||
fi
|
||||
|
||||
cd ${test_tmpdir}
|
||||
mkdir files
|
||||
cd files
|
||||
ot_files=`pwd`
|
||||
export ht_files
|
||||
ln -s nosuchfile somelink
|
||||
echo first > firstfile
|
||||
|
||||
cd ${test_tmpdir}/files
|
||||
$OSTREE commit -b test2 -s "Test Commit 1" -m "Commit body first"
|
||||
|
||||
mkdir baz
|
||||
echo moo > baz/cow
|
||||
echo alien > baz/saucer
|
||||
@@ -78,19 +94,8 @@ setup_test_repository () {
|
||||
mkdir baz/another/
|
||||
echo x > baz/another/y
|
||||
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo
|
||||
cd repo
|
||||
ot_repo="--repo=`pwd`"
|
||||
export OSTREE="ostree ${ot_repo}"
|
||||
cd ../files
|
||||
if test "$mode" = "archive"; then
|
||||
$OSTREE init --archive
|
||||
else
|
||||
$OSTREE init
|
||||
fi
|
||||
$OSTREE commit -b test2 -s "Test Commit 1" -m "Commit body first" --add=firstfile --add=somelink
|
||||
$OSTREE commit -b test2 -s "Test Commit 2" -m "Commit body second" --add=baz/cow --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y --add=baz/alink
|
||||
cd ${test_tmpdir}/files
|
||||
$OSTREE commit -b test2 -s "Test Commit 2" -m "Commit body second"
|
||||
$OSTREE fsck -q
|
||||
|
||||
cd $oldpwd
|
||||
@@ -108,13 +113,13 @@ setup_fake_remote_repo1() {
|
||||
mkdir baz
|
||||
echo moo > baz/cow
|
||||
echo alien > baz/saucer
|
||||
find | grep -v '^\.$' | ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "A remote commit" -m "Some Commit body" --from-stdin
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "A remote commit" -m "Some Commit body"
|
||||
mkdir baz/deeper
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "Add deeper" --add=baz/deeper
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "Add deeper"
|
||||
echo hi > baz/deeper/ohyeah
|
||||
mkdir baz/another/
|
||||
echo x > baz/another/y
|
||||
find | grep -v '^\.$' | ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "The rest" --from-stdin
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "The rest"
|
||||
cd ..
|
||||
rm -rf gnomerepo-files
|
||||
|
||||
|
||||
@@ -47,8 +47,9 @@ assert_file_has_content baz/cow moo
|
||||
assert_has_file baz/deeper/ohyeah
|
||||
echo "ok content"
|
||||
|
||||
$OSTREE commit -b test2 -s delete -r firstfile
|
||||
assert_has_file firstfile # It should still exist in this checkout
|
||||
rm firstfile
|
||||
$OSTREE commit -b test2 -s delete
|
||||
|
||||
cd $test_tmpdir
|
||||
$OSTREE checkout test2 $test_tmpdir/checkout-test2-2
|
||||
cd $test_tmpdir/checkout-test2-2
|
||||
@@ -95,13 +96,14 @@ echo "ok cwd contents"
|
||||
|
||||
cd ${test_tmpdir}/checkout-test2-4
|
||||
echo afile > oh-look-a-file
|
||||
cat > ostree-commit-metadata <<EOF
|
||||
cat > ${test_tmpdir}/ostree-commit-metadata <<EOF
|
||||
{'origin': <'http://example.com'>, 'buildid': <@u 42>}
|
||||
EOF
|
||||
$OSTREE commit -b test2 -s "Metadata test" --metadata-variant-text=./ostree-commit-metadata --add=oh-look-a-file
|
||||
rm ostree-commit-metadata
|
||||
$OSTREE commit -b test2 -s "Metadata test" --metadata-variant-text=${test_tmpdir}/ostree-commit-metadata
|
||||
echo "ok metadata commit"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
rm ostree-commit-metadata
|
||||
$OSTREE show test2 > ${test_tmpdir}/show
|
||||
assert_file_has_content ${test_tmpdir}/show 'example.com'
|
||||
assert_file_has_content ${test_tmpdir}/show 'buildid'
|
||||
|
||||
Reference in new issue
Block a user