Skip to content

Commit 39111f6

Browse files
antongEric Wong
authored andcommitted
test case for regression caused by git-svn empty symlink fix
Commit dbc6c74 "git-svn: handle empty files marked as symlinks in SVN" caused a regression in an unusual case where a branch has been created in SVN, later deleted and then created again from another branch point and the original branch point had empty files not in the new branch. In some cases git svn fetch will then fail while trying to fetch the empty file from the wrong SVN revision. This adds a test case that reproduces the issue. [ew: added additional test to ensure file was created correctly made test file executable ] Signed-off-by: Anton Gyllenberg <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent 8841b37 commit 39111f6

File tree

2 files changed

+208
-0
lines changed

2 files changed

+208
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
test_description='test moved svn branch with missing empty files'
4+
5+
. ./lib-git-svn.sh
6+
test_expect_success 'load svn dumpfile' '
7+
svnadmin load "$rawsvnrepo" < "${TEST_DIRECTORY}/t9135/svn.dump"
8+
'
9+
10+
test_expect_success 'clone using git svn' 'git svn clone -s "$svnrepo" x'
11+
12+
test_expect_success 'test that b1 exists and is empty' '
13+
(cd x && test -f b1 && ! test -s b1)
14+
'
15+
16+
test_done

t/t9135/svn.dump

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
SVN-fs-dump-format-version: 2
2+
3+
UUID: 1f80e919-e9e3-4d80-a3ae-d9f21095e27b
4+
5+
Revision-number: 0
6+
Prop-content-length: 56
7+
Content-length: 56
8+
9+
K 8
10+
svn:date
11+
V 27
12+
2009-02-10T19:23:16.424027Z
13+
PROPS-END
14+
15+
Revision-number: 1
16+
Prop-content-length: 123
17+
Content-length: 123
18+
19+
K 7
20+
svn:log
21+
V 20
22+
init standard layout
23+
K 10
24+
svn:author
25+
V 8
26+
john.doe
27+
K 8
28+
svn:date
29+
V 27
30+
2009-02-10T19:23:17.195072Z
31+
PROPS-END
32+
33+
Node-path: branches
34+
Node-kind: dir
35+
Node-action: add
36+
Prop-content-length: 10
37+
Content-length: 10
38+
39+
PROPS-END
40+
41+
42+
Node-path: trunk
43+
Node-kind: dir
44+
Node-action: add
45+
Prop-content-length: 10
46+
Content-length: 10
47+
48+
PROPS-END
49+
50+
51+
Revision-number: 2
52+
Prop-content-length: 121
53+
Content-length: 121
54+
55+
K 7
56+
svn:log
57+
V 18
58+
branch-b off trunk
59+
K 10
60+
svn:author
61+
V 8
62+
john.doe
63+
K 8
64+
svn:date
65+
V 27
66+
2009-02-10T19:23:19.160095Z
67+
PROPS-END
68+
69+
Node-path: branches/branch-b
70+
Node-kind: dir
71+
Node-action: add
72+
Node-copyfrom-rev: 1
73+
Node-copyfrom-path: trunk
74+
Prop-content-length: 34
75+
Content-length: 34
76+
77+
K 13
78+
svn:mergeinfo
79+
V 0
80+
81+
PROPS-END
82+
83+
84+
Revision-number: 3
85+
Prop-content-length: 120
86+
Content-length: 120
87+
88+
K 7
89+
svn:log
90+
V 17
91+
add empty file b1
92+
K 10
93+
svn:author
94+
V 8
95+
john.doe
96+
K 8
97+
svn:date
98+
V 27
99+
2009-02-10T19:23:20.194568Z
100+
PROPS-END
101+
102+
Node-path: branches/branch-b/b1
103+
Node-kind: file
104+
Node-action: add
105+
Prop-content-length: 10
106+
Text-content-length: 0
107+
Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
108+
Content-length: 10
109+
110+
PROPS-END
111+
112+
113+
Revision-number: 4
114+
Prop-content-length: 110
115+
Content-length: 110
116+
117+
K 7
118+
svn:log
119+
V 8
120+
branch-c
121+
K 10
122+
svn:author
123+
V 8
124+
john.doe
125+
K 8
126+
svn:date
127+
V 27
128+
2009-02-10T19:23:21.169100Z
129+
PROPS-END
130+
131+
Node-path: branches/branch-c
132+
Node-kind: dir
133+
Node-action: add
134+
Node-copyfrom-rev: 3
135+
Node-copyfrom-path: trunk
136+
137+
138+
Revision-number: 5
139+
Prop-content-length: 126
140+
Content-length: 126
141+
142+
K 7
143+
svn:log
144+
V 23
145+
oops, wrong branchpoint
146+
K 10
147+
svn:author
148+
V 8
149+
john.doe
150+
K 8
151+
svn:date
152+
V 27
153+
2009-02-10T19:23:21.253557Z
154+
PROPS-END
155+
156+
Node-path: branches/branch-c
157+
Node-action: delete
158+
159+
160+
Revision-number: 6
161+
Prop-content-length: 127
162+
Content-length: 127
163+
164+
K 7
165+
svn:log
166+
V 24
167+
branch-c off of branch-b
168+
K 10
169+
svn:author
170+
V 8
171+
john.doe
172+
K 8
173+
svn:date
174+
V 27
175+
2009-02-10T19:23:21.314659Z
176+
PROPS-END
177+
178+
Node-path: branches/branch-c
179+
Node-kind: dir
180+
Node-action: add
181+
Node-copyfrom-rev: 5
182+
Node-copyfrom-path: branches/branch-b
183+
Prop-content-length: 34
184+
Content-length: 34
185+
186+
K 13
187+
svn:mergeinfo
188+
V 0
189+
190+
PROPS-END
191+
192+

0 commit comments

Comments
 (0)