ln: canonicalize the parent directory of the destination, not the destination itself#2338
Merged
tertsdiepraam merged 8 commits intouutils:masterfrom Jun 12, 2021
Merged
Conversation
This information is already encoded in the `OverwriteMode` enum.
if `dst.exists()` and `settings.overwrite` is `OverwriteMode::Force`, we already delete the file in the match above.
36ead0c to
ca03c55
Compare
dst may or may not exist. In case it exists it might already be a symlink. In neither case we should try to canonicalize dst, only its parent directory. https://www.gnu.org/software/coreutils/manual/html_node/ln-invocation.html > Relative symbolic links are generated based on their canonicalized > **containing directory**, and canonicalized targets.
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.
When determining the absolute path for the destination file, the destination file might already exist and be a symlink.
Submitting as a draft because there are test failures on windows and mac that I need to investigate. So far I wasn't able to reproduce the failing test on a windows VM, so if anybody can any help would be greatly appreciated.
Will close #2335