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