Merged
Conversation
We weren't checking if the deleted path is a file or a directory and were calling `remove_file` unconditionally. Update to check for file/directory first Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
travier
approved these changes
Sep 25, 2025
cgwalters
requested changes
Sep 25, 2025
crates/lib/src/cli.rs
Outdated
| print_diff(&diff, &mut std::io::stdout()); | ||
|
|
||
| if merge { | ||
| let n = n.ok_or(anyhow::anyhow!("Failed to get dirtree for new etc"))?; |
Collaborator
There was a problem hiding this comment.
I think clippy will want ok_or_else to avoid constructing the error always (here and elsewhere)
crates/etc-merge/src/lib.rs
Outdated
| Err(e) => Err(e)?, | ||
| let stat = new_etc_fd.metadata_optional(&removed)?; | ||
|
|
||
| let stat = match stat { |
Collaborator
There was a problem hiding this comment.
Also a let-else candidate
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
fd3b99a to
1b39153
Compare
cgwalters
approved these changes
Sep 25, 2025
| traverse_etc(&pristine_etc, ¤t_etc, &new_etc)?; | ||
| traverse_etc(&pristine_etc, ¤t_etc, Some(&new_etc))?; | ||
|
|
||
| let new_files = new_files.ok_or(anyhow::anyhow!("Failed to get dirtree for new etc"))?; |
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.
No description provided.