Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
sylvestre
reviewed
Nov 18, 2026
| // than `fs::copy`, which would put the source's permission bits | ||
| // on the temporary file and undo the 0600 it was created with. | ||
| let (mut copy_file, copy_path) = tmp_dir.next_file()?; | ||
| if path_copy.is_none() { |
Contributor
There was a problem hiding this comment.
the stdin and path branches are almost the same code, could be dedup, no?
| } | ||
|
|
||
| #[test] | ||
| fn test_merge_output_is_stdin() { |
Contributor
There was a problem hiding this comment.
could you please also cover - ledger updates (both copies) as a case? thanks
|
Binary size comparison: |
This branch has not been deployed
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.
sort -m -o ledger - updates < ledgertruncatedledgerwhile the merge was still reading it through standard input, so most of the records were lost. The check for an input that is the output file only compared path operands, and-was looked up as a file named-.replace_output_file_in_input_filesnow also compares the file standard input is open on with the output file. If they are the same, it copies standard input from its current position into a temporary file of its own and merges that copy. It returns a list of copies, because a path operand and-may now both need one.The new test is the issue's case with 10,000 records and fails on
main. I also ran the issue's script by hand:mainkept 4,097 of 10,001 lines here, and the fix keeps all of them. Standard input that was already partly read is copied from where it stands, and- ledger updateskeeps both copies.Closes #16679
AI disclosure: written with help from Claude Code.