commit - 7268d4618603a3243f53ced23fc7ccc40f7d0693
commit + 6e5370b0f38658d91de41782c4fec170db11606c
blob - 6a05d1fdb99b35b3bd0a2d6a625de556f636112b
blob + 60aa45d92e435a511ad9d2363e43ceb0aa5a07c4
--- regress/gotd/repo_read.sh
+++ regress/gotd/repo_read.sh
test_done "$testroot" "$ret"
}
+test_clone_basic_git() {
+ local testroot=`test_init clone_basic_git 1`
+
+ cp -r ${GOTD_TEST_REPO} $testroot/repo-copy
+
+ git clone -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone \
+ 2> $testroot/stderr
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ echo "git clone failed unexpectedly" >&2
+ test_done "$testroot" "1"
+ return 1
+ fi
+
+ # Verify that the clone operation worked fine.
+ git_fsck "$testroot" "$testroot/repo-clone"
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ test_done "$testroot" "1"
+ return 1
+ fi
+
+ got tree -R -r "$testroot/repo-clone" > $testroot/stdout
+ cat > $testroot/stdout.expected <<EOF
+alpha
+beta
+epsilon/
+epsilon/zeta
+gamma/
+gamma/delta
+EOF
+ cmp -s $testroot/stdout.expected $testroot/stdout
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
+ fi
+
+ # cloning a repository should not result in modifications
+ diff -urN ${GOTD_TEST_REPO} $testroot/repo-copy \
+ > $testroot/stdout
+ echo -n > $testroot/stdout.expected
+ cmp -s $testroot/stdout.expected $testroot/stdout
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
+ fi
+
+ test_done "$testroot" "$ret"
+}
+
+
test_send_to_read_only_repo() {
local testroot=`test_init send_to_read_only_repo 1`
test_parseargs "$@"
run_test test_clone_basic
+run_test test_clone_basic_git
run_test test_send_to_read_only_repo