Skip to content

Add polyfill for Path.GetRelativePath(...)#23

Merged
Tyrrrz merged 6 commits into
masterfrom
get-relative-path
Nov 14, 2025
Merged

Add polyfill for Path.GetRelativePath(...)#23
Tyrrrz merged 6 commits into
masterfrom
get-relative-path

Conversation

@Tyrrrz

@Tyrrrz Tyrrrz commented Nov 14, 2025

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 14, 2025 23:26
@Tyrrrz Tyrrrz added the enhancement New feature or request label Nov 14, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a polyfill for Path.GetRelativePath(...) to enable this API for older .NET versions (pre-.NET Core 2.0, all .NET Framework, and pre-.NET Standard 2.1).

  • Implements the core relative path calculation logic using path segment comparison
  • Adds basic test coverage for common scenarios (descending paths, sibling paths, both Unix and Windows-style paths)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
PolyShim/NetCore20/Path.cs Adds the GetRelativePath polyfill implementation with platform-specific path comparison
PolyShim.Tests/NetCore20/PathTests.cs Adds test cases for the new polyfill covering basic path scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PolyShim/NetCore20/Path.cs Outdated
Comment thread PolyShim/NetCore20/Path.cs
Comment thread PolyShim/NetCore20/Path.cs
Comment thread PolyShim/NetCore20/Path.cs
Tyrrrz and others added 2 commits November 15, 2025 01:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PolyShim/NetCore20/Path.cs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants