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