Commit | Line | Data |
---|---|---|
8114da16 KB |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2008 Kevin Ballard | |
4 | # | |
5 | ||
1364ff27 | 6 | test_description='git svn clone with percent escapes' |
8114da16 KB |
7 | . ./lib-git-svn.sh |
8 | ||
f69e836f | 9 | test_expect_success 'setup svnrepo' ' |
8114da16 KB |
10 | mkdir project project/trunk project/branches project/tags && |
11 | echo foo > project/trunk/foo && | |
da083d68 | 12 | svn_cmd import -m "$test_description" project "$svnrepo/pr ject" && |
5268f9ed EW |
13 | svn_cmd cp -m "branch" "$svnrepo/pr ject/trunk" \ |
14 | "$svnrepo/pr ject/branches/b" && | |
15 | svn_cmd cp -m "tag" "$svnrepo/pr ject/trunk" \ | |
16 | "$svnrepo/pr ject/tags/v1" && | |
8114da16 KB |
17 | rm -rf project && |
18 | start_httpd | |
f69e836f | 19 | ' |
8114da16 | 20 | |
3be7e067 SB |
21 | test_expect_success 'test clone with percent escapes' ' |
22 | git svn clone "$svnrepo/pr%20ject" clone && | |
18a82692 JN |
23 | ( |
24 | cd clone && | |
fd4ec4f2 JL |
25 | git rev-parse refs/${remotes_git_svn} |
26 | ) | |
3be7e067 | 27 | ' |
8114da16 | 28 | |
5268f9ed EW |
29 | # SVN works either way, so should we... |
30 | ||
31 | test_expect_success 'svn checkout with percent escapes' ' | |
32 | svn_cmd checkout "$svnrepo/pr%20ject" svn.percent && | |
33 | svn_cmd checkout "$svnrepo/pr%20ject/trunk" svn.percent.trunk | |
34 | ' | |
35 | ||
36 | test_expect_success 'svn checkout with space' ' | |
37 | svn_cmd checkout "$svnrepo/pr ject" svn.space && | |
38 | svn_cmd checkout "$svnrepo/pr ject/trunk" svn.space.trunk | |
39 | ' | |
40 | ||
41 | test_expect_success 'test clone trunk with percent escapes and minimize-url' ' | |
42 | git svn clone --minimize-url "$svnrepo/pr%20ject/trunk" minimize && | |
43 | ( | |
44 | cd minimize && | |
45 | git rev-parse refs/${remotes_git_svn} | |
46 | ) | |
47 | ' | |
48 | ||
49 | test_expect_success 'test clone trunk with percent escapes' ' | |
50 | git svn clone "$svnrepo/pr%20ject/trunk" trunk && | |
51 | ( | |
52 | cd trunk && | |
53 | git rev-parse refs/${remotes_git_svn} | |
54 | ) | |
55 | ' | |
56 | ||
57 | test_expect_success 'test clone --stdlayout with percent escapes' ' | |
58 | git svn clone --stdlayout "$svnrepo/pr%20ject" percent && | |
59 | ( | |
60 | cd percent && | |
61 | git rev-parse refs/remotes/trunk^0 && | |
62 | git rev-parse refs/remotes/b^0 && | |
63 | git rev-parse refs/remotes/tags/v1^0 | |
64 | ) | |
65 | ' | |
66 | ||
67 | test_expect_success 'test clone -s with unescaped space' ' | |
68 | git svn clone -s "$svnrepo/pr ject" space && | |
69 | ( | |
70 | cd space && | |
71 | git rev-parse refs/remotes/trunk^0 && | |
72 | git rev-parse refs/remotes/b^0 && | |
73 | git rev-parse refs/remotes/tags/v1^0 | |
74 | ) | |
75 | ' | |
76 | ||
8114da16 KB |
77 | stop_httpd |
78 | ||
79 | test_done |