Don't default to "master", require a branch

It doesn't really make sense to have a default branch, since we expect
people to have multiple roots.  Thus, require a branch
specification always.
This commit is contained in:
Colin Walters committed 2011-10-27 21:42:44 -04:00
1 parent d145b0426c
commit ee4edf114b
15 files changed
+105 -45

No files matched your search

+4 -4
View File
@@ -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" -m "Commit body first" --add=firstfile
ostree commit $ot_repo -s "Test Commit 2" -m "Commit body second" --add=secondfile
ostree commit $ot_repo -b test -s "Test Commit 1" -m "Commit body first" --add=firstfile
ostree commit $ot_repo -b test -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" -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 commit $ot_repo -b test2 -s "Test Commit 1" -m "Commit body first" --add=firstfile
ostree commit $ot_repo -b test2 -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
}
+2 -2
View File
@@ -32,9 +32,9 @@ mkdir ../repo
repo="--repo=../repo"
ostree init $repo
echo 'ok init'
ostree commit $repo -s "Test Commit" -m "Commit body" --add=yy
ostree commit $repo -b test -s "Test Commit" -m "Commit body" --add=yy
echo 'ok commit'
ostree fsck -q $repo
echo 'ok fsck'
ostree rev-parse
ostree rev-parse $repo test
echo 'ok rev-parse'
+2 -2
View File
@@ -33,9 +33,9 @@ mkdir ../repo
repo="--repo=../repo"
ostree init $repo
echo 'ok init'
ostree commit $repo -s "Test Commit 1" -m "Commit body first" --add=firstfile
ostree commit $repo -b test -s "Test Commit 1" -m "Commit body first" --add=firstfile
echo 'ok commit 1'
ostree commit $repo -s "Test Commit 2" -m "Commit body first" --add=secondfile
ostree commit $repo -b test -s "Test Commit 2" -m "Commit body first" --add=secondfile
echo 'ok commit 2'
ostree fsck -q $repo
echo 'ok fsck'
+1 -1
View File
@@ -26,7 +26,7 @@ echo '1..3'
setup_test_repository1
echo 'ok setup'
ostree checkout $ot_repo master $test_tmpdir/checkout1-head
ostree checkout $ot_repo test $test_tmpdir/checkout1-head
echo 'ok checkout cmd'
cd $test_tmpdir/checkout1-head
assert_has_file firstfile
+1 -1
View File
@@ -26,7 +26,7 @@ echo '1..5'
setup_test_repository2
echo 'ok setup'
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
ostree checkout $ot_repo test2 $test_tmpdir/checkout2-head
echo 'ok checkout cmd'
cd $test_tmpdir/checkout2-head
assert_has_file firstfile
+3 -3
View File
@@ -25,14 +25,14 @@ set -e
echo '1..4'
setup_test_repository2
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
ostree checkout $ot_repo test2 $test_tmpdir/checkout2-head
echo 'ok setup'
cd $test_tmpdir/checkout2-head
ostree commit -s delete $ot_repo -r firstfile
ostree commit $ot_repo -b test2 -s delete -r firstfile
echo 'ok rm firstfile'
assert_has_file firstfile # It should still exist in this checkout
cd $test_tmpdir
ostree checkout $ot_repo master $test_tmpdir/checkout3-head
ostree checkout $ot_repo test2 $test_tmpdir/checkout3-head
echo 'ok checkout 3'
cd $test_tmpdir/checkout3-head
assert_not_has_file firstfile
+3 -3
View File
@@ -25,7 +25,7 @@ set -e
echo "1..2"
setup_test_repository2
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
ostree checkout $ot_repo test2 $test_tmpdir/checkout2-head
cd $test_tmpdir/checkout2-head
mkdir -p a/nested/tree
echo one > a/nested/tree/1
@@ -39,9 +39,9 @@ mkdir -p another/nested/tree
echo anotherone > another/nested/tree/1
echo whee2 > another/whee
# FIXME - remove grep for .
find | grep -v '^\.$' | ostree commit $ot_repo --from-stdin -s "From find"
find | grep -v '^\.$' | ostree commit $ot_repo -b test2 -s "From find" --from-stdin
echo "ok commit stdin"
ostree checkout $ot_repo master $test_tmpdir/checkout3-head
ostree checkout $ot_repo test2 $test_tmpdir/checkout3-head
cd $test_tmpdir/checkout3-head
assert_has_file a/nested/2
assert_file_has_content a/nested/2 'two2'
+1 -1
View File
@@ -25,7 +25,7 @@ set -e
echo "1..1"
setup_test_repository2
ostree log $ot_repo > $test_tmpdir/log.txt
ostree log $ot_repo test2 > $test_tmpdir/log.txt
assert_file_has_content $test_tmpdir/log.txt "Test Commit 1"
assert_file_has_content $test_tmpdir/log.txt "Test Commit 2"
echo "ok log"
+2 -2
View File
@@ -26,10 +26,10 @@ echo "1..2"
setup_test_repository2
ostree checkout $ot_repo master $test_tmpdir/checkout2-head
ostree checkout $ot_repo test2 $test_tmpdir/checkout2-head
cd $ht_files
ln -s foo bar
ostree commit $ot_repo -s "Add a symlink" -m "To test it" --add=bar
ostree commit $ot_repo -b test2 -s "Add a symlink" -m "To test it" --add=bar
echo "ok commit symlink"
ostree fsck $ot_repo
echo "ok fsck"
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
#
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Author: Colin Walters <walters@verbum.org>
set -e
. libtest.sh
echo '1..3'
setup_test_repository2
ostree checkout $ot_repo test2 $test_tmpdir/checkout2-head
cd $test_tmpdir/checkout2-head
echo test3file > test3file
ostree commit $ot_repo -s 'Add test3file' -b test3 -p test2 --add test3file
echo "ok commit test3 branch"
ostree checkout $ot_repo test3 $test_tmpdir/checkout3-head
echo "ok checkout test3 branch"
cd $test_tmpdir/checkout3-head
assert_has_file test3file
echo "ok checkout test3file"