Fix Tar cleanup one-liners - #131672
Draft
alinpahontu2912 wants to merge 1 commit into
Draft
Conversation
- TarEntry.Windows.cs: fix copy-paste Debug.Assert bug in ExtractAsBlockDevice/ExtractAsCharacterDevice (each asserted BlockDevice or CharacterDevice instead of its own specific type). - TarHeader.Write.cs: change GetTotalDataBytesToWrite() from public to internal, matching its containing internal sealed type and sibling helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7572f80-427a-403d-aac4-e8c856f1ba08
|
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. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-formats-tar |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens up internal correctness/cleanup in System.Formats.Tar by fixing platform-specific debug assertions for device-file extraction on Windows and by reducing unnecessary method visibility within an internal implementation type.
Changes:
- Fix
Debug.Assertconditions in Windows-only extraction helpers so each method asserts its own expectedTarEntryType. - Change
TarHeader.GetTotalDataBytesToWrite()frompublictointernalto better match the containinginternal sealedimplementation type and avoid exposing an unnecessary “public” member in metadata.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.Windows.cs | Corrects per-entry-type Debug.Assert invariants for Windows device-file extraction stubs. |
| src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs | Narrows helper method visibility (public → internal) within the internal TarHeader writer implementation. |
alinpahontu2912
marked this pull request as draft
July 31, 2026 20:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.