blob: b28271345c63e752c02d6b3b867f8c59aba08ff8 [file] [log] [blame]
Eric Wong12a6d752007-12-14 08:39:09 -08001#!/bin/sh
2#
3# Copyright (c) 2007 Eric Wong
4#
5
Nanako Shiraishi1364ff22008-09-08 19:02:08 +09006test_description='git svn tracking removed top-level path'
Eric Wong12a6d752007-12-14 08:39:09 -08007. ./lib-git-svn.sh
8
9test_expect_success 'make history for tracking' '
10 mkdir import &&
11 mkdir import/trunk &&
12 echo hello >> import/trunk/README &&
Eygene Ryabinkinda083d62009-05-08 12:06:16 +040013 svn_cmd import -m initial import "$svnrepo" &&
Eric Wong12a6d752007-12-14 08:39:09 -080014 rm -rf import &&
Eygene Ryabinkinda083d62009-05-08 12:06:16 +040015 svn_cmd co "$svnrepo"/trunk trunk &&
Eric Wong12a6d752007-12-14 08:39:09 -080016 echo bye bye >> trunk/README &&
Eygene Ryabinkinda083d62009-05-08 12:06:16 +040017 svn_cmd rm -m "gone" "$svnrepo"/trunk &&
Eric Wong12a6d752007-12-14 08:39:09 -080018 rm -rf trunk &&
19 mkdir trunk &&
20 echo "new" > trunk/FOLLOWME &&
Eygene Ryabinkinda083d62009-05-08 12:06:16 +040021 svn_cmd import -m "new trunk" trunk "$svnrepo"/trunk
Eric Wong12a6d752007-12-14 08:39:09 -080022'
23
24test_expect_success 'clone repo with git' '
Bryan Donlanf69e8362008-05-04 01:37:59 -040025 git svn clone -s "$svnrepo" x &&
Jeff King2a86cb62016-05-13 16:47:28 -040026 test_path_is_file x/FOLLOWME &&
27 test_path_is_missing x/README
Eric Wong12a6d752007-12-14 08:39:09 -080028'
29
Jeff King2a86cb62016-05-13 16:47:28 -040030test_expect_success 'make sure r2 still has old file' '
31 (
32 cd x &&
33 test -n "$(git svn find-rev r1)" &&
34 git reset --hard "$(git svn find-rev r1)" &&
35 test_path_is_file README &&
36 test_path_is_missing FOLLOWME &&
37 test -z "$(git svn find-rev r2)"
38 )
39'
Eric Wong12a6d752007-12-14 08:39:09 -080040
41test_done