Handle directory-file and file-directory comparisons in the diff#56
Merged
oSoMoN merged 5 commits intouutils:mainfrom Apr 23, 2024
Merged
Handle directory-file and file-directory comparisons in the diff#56oSoMoN merged 5 commits intouutils:mainfrom
oSoMoN merged 5 commits intouutils:mainfrom
Conversation
Contributor
Author
|
Well, this will handle $ diff -u - a < d
--- -/a 2024-04-20 22:16:11.145369745 +0530
+++ a 2024-04-20 22:15:57.785813179 +0530
@@ -1 +1 @@
-da
+a
$ cargo run -- -u - a < d
Finished dev [unoptimized + debuginfo] target(s) in 0.10s
Running `target/debug/diffutils -u - a`
Failed to read from-file: Is a directory (os error 21)GNU diff (3.9+) implementes |
8b2f67b to
7dacdb3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 81.78% 81.82% +0.03%
==========================================
Files 10 10
Lines 2877 2927 +50
Branches 740 747 +7
==========================================
+ Hits 2353 2395 +42
- Misses 503 509 +6
- Partials 21 23 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Collaborator
|
sorry but your test fails on windows with: |
GNU diff treats `diff DIRECTORY FILE` as `diff DIRECTORY/FILE FILE`
46245f3 to
65993d6
Compare
Collaborator
That would be nice to have, but it can be implemented in a followup PR. |
oSoMoN
reviewed
Apr 23, 2024
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.
GNU diff treats
diff DIRECTORY FILEasdiff DIRECTORY/FILE FILE