File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,6 +271,10 @@ func checkTrailingPeriodConflictInWindows(
271271 )
272272
273273 for _ , v := range pathComponents {
274+ if v == "." || v == ".." {
275+ continue
276+ }
277+
274278 if v != strings .TrimRight (v , "." ) {
275279 conflictDetected = true
276280
@@ -284,6 +288,10 @@ func checkTrailingPeriodConflictInWindows(
284288
285289 if ctx .autoFix && conflictDetected {
286290 for j , v := range pathComponents {
291+ if v == "." || v == ".." {
292+ continue
293+ }
294+
287295 s := strings .TrimRight (v , "." )
288296 pathComponents [j ] = s
289297 }
Original file line number Diff line number Diff line change @@ -27,6 +27,24 @@ func TestValidateWindows(t *testing.T) {
2727 },
2828 ConflictDetected : true ,
2929 },
30+ {
31+ Name : ".. and . should not trigger a conflict" ,
32+ Changes : file.Changes {
33+ {
34+ Source : "index.js" ,
35+ Target : "../index.js" ,
36+ BaseDir : "dev/nested" ,
37+ Status : status .OK ,
38+ },
39+ {
40+ Source : "main.js" ,
41+ Target : "./main.js" ,
42+ BaseDir : "dev" ,
43+ Status : status .Unchanged ,
44+ },
45+ },
46+ Want : []string {"dev/index.js" , "dev/main.js" },
47+ },
3048 {
3149 Name : "detect trailing period conflict in directories" ,
3250 Changes : file.Changes {
You can’t perform that action at this time.
0 commit comments