Skip to content

fix: resolve relative targets in Windows copy_symlink() - #212

Open
hannahgreendesk wants to merge 2 commits into
gulrak:masterfrom
hannahgreendesk:fix/copy-symlink-relative-target-211
Open

fix: resolve relative targets in Windows copy_symlink()#212
hannahgreendesk wants to merge 2 commits into
gulrak:masterfrom
hannahgreendesk:fix/copy-symlink-relative-target-211

Conversation

@hannahgreendesk

Copy link
Copy Markdown

Summary

On Windows, copy_symlink() classifies the new link as a file or directory symlink by probing the stored target path. Relative targets were resolved against the process working directory, so an unrelated cwd entry (or a missing one) could pick the wrong link type.

Resolve relative targets against the source symlink's parent for that lookup only. The text stored in the source link is still passed unchanged to create_symlink / create_directory_symlink.

Test plan

  • Extended fs.op.copy_symlink with a nested relative directory symlink copy case (nested/slink"dir").
  • CI on Windows (symlink creation supported) confirms the new checks.

Fixes #211

Signed-off-by: hannahgreendesk <hannahgreendesk@users.noreply.github.com>
Signed-off-by: hannahgreendesk <hannahgreendesk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve relative targets correctly in Windows copy_symlink()

1 participant