]> arthur.barton.de Git - bup.git/blobdiff - t/test-on.sh
test-meta.sh: don't test for bup.1
[bup.git] / t / test-on.sh
index c3ee46016751d74c627829e4b9bbc9d1d312bd0b..61e6dd847d037556ef97b5d14965e6581f5b3a30 100755 (executable)
@@ -21,13 +21,25 @@ WVPASS mkdir src src/foo
 WVPASS date > src/bar
 WVPASS bup random 1k > src/baz
 WVPASS bup on - index src
-WVPASS bup on - save -n src src
+WVPASS bup on - save -ctn src src > get.log
+WVPASSEQ "$(cat get.log | wc -l)" 2
+tree_id=$(WVPASS awk 'FNR == 1' get.log) || exit $?
+commit_id=$(WVPASS awk 'FNR == 2' get.log) || exit $?
+WVPASS git ls-tree "$tree_id"
+WVPASS git cat-file commit "$commit_id" | head -n 1 \
+    | WVPASS grep "^tree $tree_id\$"
+
 WVPASS bup restore -C restore "src/latest/$(pwd)/src/."
 WVPASS compare-trees src/ restore/
 WVPASS rm -r restore
 
 WVSTART "split"
-WVPASS bup on - split -n baz src/baz
+WVPASS bup on - split -ctn baz src/baz > get.log
+tree_id=$(WVPASS awk 'FNR == 1' get.log) || exit $?
+commit_id=$(WVPASS awk 'FNR == 2' get.log) || exit $?
+WVPASS git ls-tree "$tree_id"
+WVPASS git cat-file commit "$commit_id" | head -n 1 \
+    | WVPASS grep "^tree $tree_id\$"
 WVPASS bup join baz > restore-baz
 WVPASS cmp src/baz restore-baz