@@ -151,9 +151,10 @@ func TestCleanPath(t *testing.T) {
151
151
{[]string {`a\..\b` }, `a\..\b` },
152
152
{[]string {`a` , `` , `b` }, `a/b` },
153
153
{[]string {`a` , `..` , `b` }, `a/b` },
154
+ {[]string {`lfs` , `repo/..` , `user/../path` }, `lfs/path` },
154
155
}
155
156
for _ , c := range cases {
156
- assert .Equal (t , c .expected , SafePathRel (c .elems ... ), "case: %v" , c .elems )
157
+ assert .Equal (t , c .expected , PathJoinRel (c .elems ... ), "case: %v" , c .elems )
157
158
}
158
159
159
160
cases = []struct {
@@ -169,9 +170,10 @@ func TestCleanPath(t *testing.T) {
169
170
{[]string {`a\..\b` }, `b` },
170
171
{[]string {`a` , `` , `b` }, `a/b` },
171
172
{[]string {`a` , `..` , `b` }, `a/b` },
173
+ {[]string {`lfs` , `repo/..` , `user/../path` }, `lfs/path` },
172
174
}
173
175
for _ , c := range cases {
174
- assert .Equal (t , c .expected , SafePathRelX (c .elems ... ), "case: %v" , c .elems )
176
+ assert .Equal (t , c .expected , PathJoinRelX (c .elems ... ), "case: %v" , c .elems )
175
177
}
176
178
177
179
// for POSIX only, but the result is similar on Windows, because the first element must be an absolute path
@@ -187,6 +189,7 @@ func TestCleanPath(t *testing.T) {
187
189
{[]string {`C:\a/..\b` }, `C:\b` },
188
190
{[]string {`C:\a` , `` , `b` }, `C:\a\b` },
189
191
{[]string {`C:\a` , `..` , `b` }, `C:\a\b` },
192
+ {[]string {`C:\lfs` , `repo/..` , `user/../path` }, `C:\lfs\path` },
190
193
}
191
194
} else {
192
195
cases = []struct {
@@ -200,9 +203,10 @@ func TestCleanPath(t *testing.T) {
200
203
{[]string {`/a\..\b` }, `/b` },
201
204
{[]string {`/a` , `` , `b` }, `/a/b` },
202
205
{[]string {`/a` , `..` , `b` }, `/a/b` },
206
+ {[]string {`/lfs` , `repo/..` , `user/../path` }, `/lfs/path` },
203
207
}
204
208
}
205
209
for _ , c := range cases {
206
- assert .Equal (t , c .expected , SafeFilePathAbs (c .elems ... ), "case: %v" , c .elems )
210
+ assert .Equal (t , c .expected , FilePathJoinAbs (c .elems ... ), "case: %v" , c .elems )
207
211
}
208
212
}
0 commit comments