@@ -151,9 +151,10 @@ func TestCleanPath(t *testing.T) {
151151 {[]string {`a\..\b` }, `a\..\b` },
152152 {[]string {`a` , `` , `b` }, `a/b` },
153153 {[]string {`a` , `..` , `b` }, `a/b` },
154+ {[]string {`lfs` , `repo/..` , `user/../path` }, `lfs/path` },
154155 }
155156 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 )
157158 }
158159
159160 cases = []struct {
@@ -169,9 +170,10 @@ func TestCleanPath(t *testing.T) {
169170 {[]string {`a\..\b` }, `b` },
170171 {[]string {`a` , `` , `b` }, `a/b` },
171172 {[]string {`a` , `..` , `b` }, `a/b` },
173+ {[]string {`lfs` , `repo/..` , `user/../path` }, `lfs/path` },
172174 }
173175 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 )
175177 }
176178
177179 // 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) {
187189 {[]string {`C:\a/..\b` }, `C:\b` },
188190 {[]string {`C:\a` , `` , `b` }, `C:\a\b` },
189191 {[]string {`C:\a` , `..` , `b` }, `C:\a\b` },
192+ {[]string {`C:\lfs` , `repo/..` , `user/../path` }, `C:\lfs\path` },
190193 }
191194 } else {
192195 cases = []struct {
@@ -200,9 +203,10 @@ func TestCleanPath(t *testing.T) {
200203 {[]string {`/a\..\b` }, `/b` },
201204 {[]string {`/a` , `` , `b` }, `/a/b` },
202205 {[]string {`/a` , `..` , `b` }, `/a/b` },
206+ {[]string {`/lfs` , `repo/..` , `user/../path` }, `/lfs/path` },
203207 }
204208 }
205209 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 )
207211 }
208212}
0 commit comments