Skip to content

Fix double slash when rejoining USTAR prefix and name - #131793

Merged
alinpahontu2912 merged 2 commits into
mainfrom
copilot/reduce-per-entry-allocation-in-ustar-attribute-rea
Sep 10, 2026
Merged

alinpahontu2912 merged 2 commits into
mainfrom
copilot/reduce-per-entry-allocation-in-ustar-attribute-rea

Conversation

Copilot AI commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

ReadUstarAttributes unconditionally joined a non-empty ustar prefix and name with /, assuming the prefix never already ends with a separator. Archives with a trailing-slash prefix produced a synthesized // in the resulting logical path.

Changes

  • TarHeader.Read.cs: check whether _prefix already ends with / before inserting the separator when rejoining prefix and name.
_name = _prefix.EndsWith('/') ? $"{_prefix}{_name}" : $"{_prefix}/{_name}";

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Fixes USTAR header name reconstruction so archives that (incorrectly) include a trailing / in the prefix field don’t produce a synthesized // when combining prefix + name.

Changes:

  • Update ReadUstarAttributes to conditionally insert the / separator only when _prefix doesn’t already end with /.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-formats-tar
See info in area-owners.md if you want to be subscribed.

Copilot AI review requested due to automatic review settings August 4, 2026 11:25

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 no new comments.

@alinpahontu2912

Copy link
Copy Markdown
Member

@copilot address the remaining comment

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the remaining comment

Addressed in 465b31b with a raw USTAR header regression test using prefix = "./sdk/"; the targeted test passes.

Note

AI/Copilot-generated response.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@alinpahontu2912
alinpahontu2912 enabled auto-merge (squash) September 10, 2026 11:37
@alinpahontu2912

Copy link
Copy Markdown
Member

/ba-g failures are unrelated

@alinpahontu2912
alinpahontu2912 merged commit 0a719e7 into main Sep 10, 2026
94 of 98 checks passed
@alinpahontu2912
alinpahontu2912 deleted the copilot/reduce-per-entry-allocation-in-ustar-attribute-rea branch September 10, 2026 11:37
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants