core: remove HEAD file, use branches instead
HEAD in git describes a working copy, and we don't have those. Instead, default to a "master" branch. This also lets us support multiple branches.
This commit is contained in:
1 parent
6924e79e60
commit
7ca1c3d2e7
16 files changed
+319
-190
No files matched your search
+5
-5
@@ -25,7 +25,7 @@ cd "$test_tmpdir"
|
||||
touch "$test_tmpdir/.test$$"
|
||||
|
||||
die () {
|
||||
if test -z "$HT_TESTS_SAVE_TEMPS"; then
|
||||
if test -z "$OT_TESTS_SAVE_TEMPS"; then
|
||||
test -f "$test_tmpdir/.test$$" && rm -rf "$test_tmpdir"
|
||||
else
|
||||
echo "Temporary files saved in $test_tmpdir"
|
||||
@@ -60,8 +60,8 @@ setup_test_repository1 () {
|
||||
ot_repo="--repo=../repo"
|
||||
export ot_repo
|
||||
ostree init $ot_repo
|
||||
ostree commit $ot_repo -s "Test Commit 1" -b "Commit body first" --add=firstfile
|
||||
ostree commit $ot_repo -s "Test Commit 2" -b "Commit body second" --add=secondfile
|
||||
ostree commit $ot_repo -s "Test Commit 1" -m "Commit body first" --add=firstfile
|
||||
ostree commit $ot_repo -s "Test Commit 2" -m "Commit body second" --add=secondfile
|
||||
ostree fsck -q $ot_repo
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ setup_test_repository2 () {
|
||||
cd ../files
|
||||
export ot_repo
|
||||
ostree init $ot_repo
|
||||
ostree commit $ot_repo -s "Test Commit 1" -b "Commit body first" --add=firstfile
|
||||
ostree commit $ot_repo -s "Test Commit 2" -b "Commit body second" --add=baz/cow --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y
|
||||
ostree commit $ot_repo -s "Test Commit 1" -m "Commit body first" --add=firstfile
|
||||
ostree commit $ot_repo -s "Test Commit 2" -m "Commit body second" --add=baz/cow --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y
|
||||
ostree fsck -q $ot_repo
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ mkdir ../repo
|
||||
repo="--repo=../repo"
|
||||
ostree init $repo
|
||||
echo 'ok init'
|
||||
ostree commit $repo -s "Test Commit" -b "Commit body" --add=yy
|
||||
ostree commit $repo -s "Test Commit" -m "Commit body" --add=yy
|
||||
echo 'ok commit'
|
||||
ostree fsck -q $repo
|
||||
echo 'ok fsck'
|
||||
@@ -33,9 +33,9 @@ mkdir ../repo
|
||||
repo="--repo=../repo"
|
||||
ostree init $repo
|
||||
echo 'ok init'
|
||||
ostree commit $repo -s "Test Commit 1" -b "Commit body first" --add=firstfile
|
||||
ostree commit $repo -s "Test Commit 1" -m "Commit body first" --add=firstfile
|
||||
echo 'ok commit 1'
|
||||
ostree commit $repo -s "Test Commit 2" -b "Commit body first" --add=secondfile
|
||||
ostree commit $repo -s "Test Commit 2" -m "Commit body first" --add=secondfile
|
||||
echo 'ok commit 2'
|
||||
ostree fsck -q $repo
|
||||
echo 'ok fsck'
|
||||
@@ -26,7 +26,7 @@ echo '1..3'
|
||||
|
||||
setup_test_repository1
|
||||
echo 'ok setup'
|
||||
ostree checkout $ot_repo HEAD $test_tmpdir/checkout1-head
|
||||
ostree checkout $ot_repo master $test_tmpdir/checkout1-head
|
||||
echo 'ok checkout cmd'
|
||||
cd $test_tmpdir/checkout1-head
|
||||
assert_has_file firstfile
|
||||
|
||||
@@ -26,7 +26,7 @@ echo '1..5'
|
||||
|
||||
setup_test_repository2
|
||||
echo 'ok setup'
|
||||
ostree checkout $ot_repo HEAD $test_tmpdir/checkout2-head
|
||||
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
|
||||
echo 'ok checkout cmd'
|
||||
cd $test_tmpdir/checkout2-head
|
||||
assert_has_file firstfile
|
||||
|
||||
@@ -25,14 +25,14 @@ set -e
|
||||
echo '1..4'
|
||||
|
||||
setup_test_repository2
|
||||
ostree checkout $ot_repo HEAD $test_tmpdir/checkout2-head
|
||||
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
|
||||
echo 'ok setup'
|
||||
cd $test_tmpdir/checkout2-head
|
||||
ostree commit -s delete $ot_repo -r firstfile
|
||||
echo 'ok rm firstfile'
|
||||
assert_has_file firstfile # It should still exist in this checkout
|
||||
cd $test_tmpdir
|
||||
ostree checkout $ot_repo HEAD $test_tmpdir/checkout3-head
|
||||
ostree checkout $ot_repo master $test_tmpdir/checkout3-head
|
||||
echo 'ok checkout 3'
|
||||
cd $test_tmpdir/checkout3-head
|
||||
assert_not_has_file firstfile
|
||||
|
||||
@@ -25,7 +25,7 @@ set -e
|
||||
echo "1..2"
|
||||
|
||||
setup_test_repository2
|
||||
ostree checkout $ot_repo HEAD $test_tmpdir/checkout2-head
|
||||
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
|
||||
cd $test_tmpdir/checkout2-head
|
||||
mkdir -p a/nested/tree
|
||||
echo one > a/nested/tree/1
|
||||
@@ -41,7 +41,7 @@ echo whee2 > another/whee
|
||||
# FIXME - remove grep for .
|
||||
find | grep -v '^\.$' | ostree commit $ot_repo --from-stdin -s "From find"
|
||||
echo "ok commit stdin"
|
||||
ostree checkout $ot_repo HEAD $test_tmpdir/checkout3-head
|
||||
ostree checkout $ot_repo master $test_tmpdir/checkout3-head
|
||||
cd $test_tmpdir/checkout3-head
|
||||
assert_has_file a/nested/2
|
||||
assert_file_has_content a/nested/2 'two2'
|
||||
|
||||
@@ -26,10 +26,10 @@ echo "1..2"
|
||||
|
||||
setup_test_repository2
|
||||
|
||||
ostree checkout $ot_repo HEAD $test_tmpdir/checkout2-head
|
||||
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
|
||||
cd $ht_files
|
||||
ln -s foo bar
|
||||
ostree commit $ot_repo -s "Add a symlink" -b "To test it" --add=bar
|
||||
ostree commit $ot_repo -s "Add a symlink" -m "To test it" --add=bar
|
||||
echo "ok commit symlink"
|
||||
ostree fsck $ot_repo
|
||||
echo "ok fsck"
|
||||
Reference in new issue
Block a user