2007-12-14 19:39:09 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 Eric Wong
|
|
|
|
#
|
|
|
|
|
2008-09-08 14:02:08 +04:00
|
|
|
test_description='git svn tracking removed top-level path'
|
2007-12-14 19:39:09 +03: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 12:06:16 +04:00
|
|
|
svn_cmd import -m initial import "$svnrepo" &&
|
2007-12-14 19:39:09 +03:00
|
|
|
rm -rf import &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd co "$svnrepo"/trunk trunk &&
|
2007-12-14 19:39:09 +03:00
|
|
|
echo bye bye >> trunk/README &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd rm -m "gone" "$svnrepo"/trunk &&
|
2007-12-14 19:39:09 +03:00
|
|
|
rm -rf trunk &&
|
|
|
|
mkdir trunk &&
|
|
|
|
echo "new" > trunk/FOLLOWME &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd import -m "new trunk" trunk "$svnrepo"/trunk
|
2007-12-14 19:39:09 +03:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'clone repo with git' '
|
2008-05-04 09:37:59 +04:00
|
|
|
git svn clone -s "$svnrepo" x &&
|
2016-05-13 23:47:28 +03:00
|
|
|
test_path_is_file x/FOLLOWME &&
|
|
|
|
test_path_is_missing x/README
|
2007-12-14 19:39:09 +03:00
|
|
|
'
|
|
|
|
|
2016-05-13 23:47:28 +03: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-14 19:39:09 +03:00
|
|
|
|
|
|
|
test_done
|