Repository navigation
install: accept piped input when replacing an existing file - #15438
Merged
Merged
Conversation
sylvestre
reviewed
Oct 17, 2026
| ); | ||
| } | ||
|
|
||
| let mut handle = File::open(from)?; |
Contributor
There was a problem hiding this comment.
why is this move needed for the pipe case? copy_file_safe still unlinks first
sylvestre
reviewed
Oct 17, 2026
| if create_leading { | ||
| ucmd.arg("-D"); | ||
| } | ||
| ucmd.arg("/dev/fd/0") |
Contributor
There was a problem hiding this comment.
could you also test /dev/stdin? it's the one from the issue
limadog9
force-pushed
the
fix/install-piped-input
branch
from
October 17, 2026 12:40
704245b to
8c6807c
Compare
Contributor
Author
|
@sylvestre Thanks, you’re right—the source-open move wasn’t needed for the pipe fix, so I removed it. The test now covers both /dev/stdin and /dev/fd/0, including existing targets, backups, and -D. |
limadog9
force-pushed
the
fix/install-piped-input
branch
from
October 17, 2026 14:50
8c6807c to
af4a50c
Compare
sylvestre
reviewed
Oct 18, 2026
|
|
||
| #[test] | ||
| #[rstest::rstest] | ||
| #[cfg(unix)] |
Contributor
There was a problem hiding this comment.
could you please move #[cfg(unix)] above #[rstest::rstest]? here rstest applies it only to the fd case
limadog9
force-pushed
the
fix/install-piped-input
branch
from
October 18, 2026 22:34
af4a50c to
8a2c55d
Compare
Contributor
|
Thanks for your PR |
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.
Allow piped /dev/stdin and /dev/fd/0 sources when replacing an existing file, including with backups and -D. Preserve same-file checks and open the source before removing the destination.
Closes #12407