Skip to content

PathCollapser.Collapse breaks UNC paths #3859

@nils-a

Description

@nils-a

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

2,1,0

Operating system

Linux, Windows

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

Given the following Cake script:

var target = Argument("target", "Default");

Task("Default")
.Does(() => {
   var one = new DirectoryPath("\\\\server\\share\\folder\\..");
   var two = one.Collapse();
   Information($"1: {one.FullPath} IsUNC:{one.IsUNC}");
   Information($"2: {two.FullPath} IsUNC:{two.IsUNC}");
});

RunTarget(target);

The output is:

========================================
Default
========================================
1: \\server\share\folder\.. IsUNC:True
2: //server/share IsUNC:False

What is expected?

I would expect a collapsed UNC path to start with \\ and not //, also I would expect IsUNC to return true.

Steps to Reproduce

See script above.

Output log

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions