2007-12-15 00:39:09 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 Eric Wong
|
|
|
|
#
|
|
|
|
|
2008-09-08 18:02:08 +08:00
|
|
|
test_description='git svn tracking removed top-level path'
|
2007-12-15 00:39:09 +08:00
|
|
|
. ./lib-git-svn.sh
|
|
|
|
|
|
|
|
test_expect_success 'make history for tracking' '
|
|
|
|
mkdir import &&
|
|
|
|
mkdir import/trunk &&
|
|
|
|
echo hello >> import/trunk/README &&
|
2009-05-08 16:06:16 +08:00
|
|
|
svn_cmd import -m initial import "$svnrepo" &&
|
2007-12-15 00:39:09 +08:00
|
|
|
rm -rf import &&
|
2009-05-08 16:06:16 +08:00
|
|
|
svn_cmd co "$svnrepo"/trunk trunk &&
|
2007-12-15 00:39:09 +08:00
|
|
|
echo bye bye >> trunk/README &&
|
2009-05-08 16:06:16 +08:00
|
|
|
svn_cmd rm -m "gone" "$svnrepo"/trunk &&
|
2007-12-15 00:39:09 +08:00
|
|
|
rm -rf trunk &&
|
|
|
|
mkdir trunk &&
|
|
|
|
echo "new" > trunk/FOLLOWME &&
|
2009-05-08 16:06:16 +08:00
|
|
|
svn_cmd import -m "new trunk" trunk "$svnrepo"/trunk
|
2007-12-15 00:39:09 +08:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'clone repo with git' '
|
2008-05-04 13:37:59 +08:00
|
|
|
git svn clone -s "$svnrepo" x &&
|
2007-12-15 00:39:09 +08:00
|
|
|
test -f x/FOLLOWME &&
|
|
|
|
test ! -f x/README
|
|
|
|
'
|
|
|
|
|
2008-05-04 13:37:59 +08:00
|
|
|
test_expect_success 'make sure r2 still has old file' "
|
2007-12-15 00:39:09 +08:00
|
|
|
cd x &&
|
2008-05-04 13:37:59 +08:00
|
|
|
test -n \"\$(git svn find-rev r1)\" &&
|
|
|
|
git reset --hard \$(git svn find-rev r1) &&
|
2007-12-15 00:39:09 +08:00
|
|
|
test -f README &&
|
|
|
|
test ! -f FOLLOWME &&
|
2008-05-04 13:37:59 +08:00
|
|
|
test x\$(git svn find-rev r2) = x
|
|
|
|
"
|
2007-12-15 00:39:09 +08:00
|
|
|
|
|
|
|
test_done
|