Skip to content

Commit 41337e2

Browse files
author
Eric Wong
committed
git-svn: add tests for command-line usage of init and clone commands
Some patches broke these commands in certain cases and were only caught by manual testing. Signed-off-by: Eric Wong <normalperson@yhbt.net>
1 parent 41a7aa5 commit 41337e2

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

t/t9117-git-svn-init-clone.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2007 Eric Wong
4+
#
5+
6+
test_description='git-svn init/clone tests'
7+
8+
. ./lib-git-svn.sh
9+
10+
# setup, run inside tmp so we don't have any conflicts with $svnrepo
11+
set -e
12+
rm -r .git
13+
mkdir tmp
14+
cd tmp
15+
16+
test_expect_success 'setup svnrepo' "
17+
mkdir project project/trunk project/branches project/tags &&
18+
echo foo > project/trunk/foo &&
19+
svn import -m '$test_description' project $svnrepo/project &&
20+
rm -rf project
21+
"
22+
23+
test_expect_success 'basic clone' "
24+
test ! -d trunk &&
25+
git svn clone $svnrepo/project/trunk &&
26+
test -d trunk/.git/svn &&
27+
test -e trunk/foo &&
28+
rm -rf trunk
29+
"
30+
31+
test_expect_success 'clone to target directory' "
32+
test ! -d target &&
33+
git svn clone $svnrepo/project/trunk target &&
34+
test -d target/.git/svn &&
35+
test -e target/foo &&
36+
rm -rf target
37+
"
38+
39+
test_expect_success 'clone with --stdlayout' "
40+
test ! -d project &&
41+
git svn clone -s $svnrepo/project &&
42+
test -d project/.git/svn &&
43+
test -e project/foo &&
44+
rm -rf project
45+
"
46+
47+
test_expect_success 'clone to target directory with --stdlayout' "
48+
test ! -d target &&
49+
git svn clone -s $svnrepo/project target &&
50+
test -d target/.git/svn &&
51+
test -e target/foo &&
52+
rm -rf target
53+
"
54+
55+
test_done

0 commit comments

Comments
 (0)