fix decompression without dir #962
Conversation
|
Why extracting the a new dir is better:
Edit:
Edit2: added the solution discussed in #963 |
596f892 to
ebc24be
Compare
|
This PR now implements the decompression as discussed in #963 |
|
I will add some more tests to ensure this does not overlook any edge cases |
|
Alright 👍, when you're done maybe I'll add a test too. |
cbf6300 to
3363c77
Compare
|
Ok, the tests are now all successful. This should be ready to be merged |
|
You also fixed majestic... I'll add a test for that to ensure it's not broken in the future. |
|
@valoq I pushed 2 new tests I'd like you to take a look and review in the last commit. We can't cover all the scenarios nicely, now when To entirely solve this, we'd need to check for conflicts on every single file extracted, that's possible and I was working on that on another branch but it sounds simpler than it really is, there is a lot of emergent complexity for merging files on conflicts and correctly decompressing files even when a parent folder was renamed, by taking over the responsibility of conflict handling we also have to add more code to check for vulnerabilities that crates check for us. Well anyways, please review the extra code and tell me if you see any problem, I think it's great for the scope of this PR, and the rest can be addressed properly later. Signed: a929d4c4e |
to fullfil this promise: ``` // Each step leaves the filesystem in a consistent state, and a failure midway // leaves the user with valid extracted content (just nested one level). ```
This reverts commit ec497cf. That crate is unix-only but we want these tests to pass on Windows too oof
the tests evidence that there is some inconsistency today between how '--dir' works when pointing to CWD or not when it points to CWD, it overwrites files inside of it without asking, that is a side-effect of this PR fixing it asking to remove CWD entirely
3c3c057 to
8c95ba5
Compare
|
Just did a rebase to solve conflicts. |
LGTM |
Addresses #958
Sorry for the duplicate PR, git hates me today