2007-11-17 20:47:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 Eric Wong
|
|
|
|
#
|
|
|
|
|
2008-09-08 10:02:08 +00:00
|
|
|
test_description='git svn init/clone tests'
|
2007-11-17 20:47:16 +00:00
|
|
|
|
|
|
|
. ./lib-git-svn.sh
|
|
|
|
|
|
|
|
# setup, run inside tmp so we don't have any conflicts with $svnrepo
|
|
|
|
set -e
|
|
|
|
rm -r .git
|
|
|
|
mkdir tmp
|
|
|
|
cd tmp
|
|
|
|
|
2008-05-04 05:37:59 +00:00
|
|
|
test_expect_success 'setup svnrepo' '
|
2007-11-17 20:47:16 +00:00
|
|
|
mkdir project project/trunk project/branches project/tags &&
|
|
|
|
echo foo > project/trunk/foo &&
|
2009-05-08 08:06:16 +00:00
|
|
|
svn_cmd import -m "$test_description" project "$svnrepo"/project &&
|
2007-11-17 20:47:16 +00:00
|
|
|
rm -rf project
|
2008-05-04 05:37:59 +00:00
|
|
|
'
|
2007-11-17 20:47:16 +00:00
|
|
|
|
2008-05-04 05:37:59 +00:00
|
|
|
test_expect_success 'basic clone' '
|
2007-11-17 20:47:16 +00:00
|
|
|
test ! -d trunk &&
|
2008-05-04 05:37:59 +00:00
|
|
|
git svn clone "$svnrepo"/project/trunk &&
|
2007-11-17 20:47:16 +00:00
|
|
|
test -d trunk/.git/svn &&
|
|
|
|
test -e trunk/foo &&
|
|
|
|
rm -rf trunk
|
2008-05-04 05:37:59 +00:00
|
|
|
'
|
2007-11-17 20:47:16 +00:00
|
|
|
|
2008-05-04 05:37:59 +00:00
|
|
|
test_expect_success 'clone to target directory' '
|
2007-11-17 20:47:16 +00:00
|
|
|
test ! -d target &&
|
2008-05-04 05:37:59 +00:00
|
|
|
git svn clone "$svnrepo"/project/trunk target &&
|
2007-11-17 20:47:16 +00:00
|
|
|
test -d target/.git/svn &&
|
|
|
|
test -e target/foo &&
|
|
|
|
rm -rf target
|
2008-05-04 05:37:59 +00:00
|
|
|
'
|
2007-11-17 20:47:16 +00:00
|
|
|
|
2008-05-04 05:37:59 +00:00
|
|
|
test_expect_success 'clone with --stdlayout' '
|
2007-11-17 20:47:16 +00:00
|
|
|
test ! -d project &&
|
2008-05-04 05:37:59 +00:00
|
|
|
git svn clone -s "$svnrepo"/project &&
|
2007-11-17 20:47:16 +00:00
|
|
|
test -d project/.git/svn &&
|
|
|
|
test -e project/foo &&
|
|
|
|
rm -rf project
|
2008-05-04 05:37:59 +00:00
|
|
|
'
|
2007-11-17 20:47:16 +00:00
|
|
|
|
2008-05-04 05:37:59 +00:00
|
|
|
test_expect_success 'clone to target directory with --stdlayout' '
|
2007-11-17 20:47:16 +00:00
|
|
|
test ! -d target &&
|
2008-05-04 05:37:59 +00:00
|
|
|
git svn clone -s "$svnrepo"/project target &&
|
2007-11-17 20:47:16 +00:00
|
|
|
test -d target/.git/svn &&
|
|
|
|
test -e target/foo &&
|
|
|
|
rm -rf target
|
2008-05-04 05:37:59 +00:00
|
|
|
'
|
2007-11-17 20:47:16 +00:00
|
|
|
|
|
|
|
test_done
|