summaryrefslogtreecommitdiff
path: root/tests/basic-test.sh
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-10-03 17:34:06 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-10-10 13:02:08 +0000
commitbba7eb80699cb789f31914bc98fc338c46237b37 (patch)
tree95a2a7f56342aa968ad07ffafb810f78f45bc19c /tests/basic-test.sh
parentfc33ae018dccbcab633b69474db0811987355212 (diff)
downloadostree-bba7eb80699cb789f31914bc98fc338c46237b37.tar.gz
commit: Add _CONSUME modifier flag
For many cases of commit, we can actually optimize things by simply "adopting" the object rather than writing a new copy. For example, in rpm-ostree package layering. We can only make that optimization though if we take ownership of the file. This commit hence adds an API where a caller tells us to do so. For now, that just means we `unlink()` the files/dirs as we go, but we can now later add the "adopt" optimization. Closes: #1255 Approved by: jlebon
Diffstat (limited to 'tests/basic-test.sh')
-rw-r--r--tests/basic-test.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/basic-test.sh b/tests/basic-test.sh
index a01f437a..037f7b45 100644
--- a/tests/basic-test.sh
+++ b/tests/basic-test.sh
@@ -19,7 +19,7 @@
set -euo pipefail
-echo "1..$((73 + ${extra_basic_tests:-0}))"
+echo "1..$((74 + ${extra_basic_tests:-0}))"
CHECKOUT_U_ARG=""
CHECKOUT_H_ARGS="-H"
@@ -178,6 +178,16 @@ assert_file_has_content four '4'
echo "ok cwd contents"
cd ${test_tmpdir}
+rm checkout-test2-l -rf
+$OSTREE checkout ${CHECKOUT_H_ARGS} test2 $test_tmpdir/checkout-test2-l
+date > $test_tmpdir/checkout-test2-l/newdatefile.txt
+$OSTREE commit --link-checkout-speedup --consume -b test2 --tree=dir=$test_tmpdir/checkout-test2-l
+assert_not_has_dir $test_tmpdir/checkout-test2-l
+# Some of the later tests are sensitive to state
+$OSTREE reset test2 test2^
+echo "ok consume (nom nom nom)"
+
+cd ${test_tmpdir}
$OSTREE commit ${COMMIT_ARGS} -b test2-no-parent -s '' $test_tmpdir/checkout-test2-4
assert_streq $($OSTREE log test2-no-parent |grep '^commit' | wc -l) "1"
$OSTREE commit ${COMMIT_ARGS} -b test2-no-parent -s '' --parent=none $test_tmpdir/checkout-test2-4