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 &&
|
2016-05-14 04:47:28 +08:00
|
|
|
test_path_is_file x/FOLLOWME &&
|
|
|
|
test_path_is_missing x/README
|
2007-12-15 00:39:09 +08:00
|
|
|
'
|
|
|
|
|
2016-05-14 04:47:28 +08:00
|
|
|
test_expect_success 'make sure r2 still has old file' '
|
|
|
|
(
|
|
|
|
cd x &&
|
|
|
|
test -n "$(git svn find-rev r1)" &&
|
|
|
|
git reset --hard "$(git svn find-rev r1)" &&
|
|
|
|
test_path_is_file README &&
|
|
|
|
test_path_is_missing FOLLOWME &&
|
|
|
|
test -z "$(git svn find-rev r2)"
|
|
|
|
)
|
|
|
|
'
|
2007-12-15 00:39:09 +08:00
|
|
|
|
|
|
|
test_done
|