Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix regression in Move-Item to only fallback to CopyAndDelete in specific cases#16029

Merged
iSazonov merged 4 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:move-item-2SteveL-MSFT/PowerShell:move-item-2Copy head branch name to clipboard
Sep 8, 2021
Merged

Fix regression in Move-Item to only fallback to CopyAndDelete in specific cases#16029
iSazonov merged 4 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:move-item-2SteveL-MSFT/PowerShell:move-item-2Copy head branch name to clipboard

Conversation

@SteveL-MSFT

@SteveL-MSFT SteveL-MSFT commented Aug 31, 2021

Copy link
Copy Markdown
Member

PR Summary

If Move fails, check if known case before attempting CopyAndDelete:

  • if an item is attempted to be renamed across filesystem mount boundaries.
  • if the source and destination do not have the same root path

PR Context

#15077 introduced a regression where it would fall through to CopyAndDelete on any IOException including where the destination doesn't exist (and probably other cases as well).

Fix #16000

PR Checklist

@SteveL-MSFT SteveL-MSFT requested a review from anmenaga as a code owner August 31, 2021 22:12
@ghost ghost assigned iSazonov Aug 31, 2021

@PaulHigin PaulHigin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread src/System.Management.Automation/namespaces/FileSystemProvider.cs Outdated
Comment thread src/System.Management.Automation/namespaces/FileSystemProvider.cs Outdated
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

@iSazonov are you good with the changes?

@iSazonov iSazonov merged commit 5872e47 into PowerShell:master Sep 8, 2021
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 8, 2021
@iSazonov iSazonov added this to the 7.2.0-rc.1 milestone Sep 8, 2021
@iSazonov

iSazonov commented Sep 8, 2021

Copy link
Copy Markdown
Collaborator

I hope to discuss the issues with .Net team. Perhaps they will approve to enhance MoveTo() with copy-and-delete.

@SteveL-MSFT SteveL-MSFT deleted the move-item-2 branch September 8, 2021 16:01
TravisEz13 pushed a commit that referenced this pull request Sep 29, 2021
…ecific cases (#16029)

If Move fails, check if known case before attempting CopyAndDelete:

- if an item is attempted to be renamed across filesystem mount boundaries.
- if the source and destination do not have the same root path.
@ghost

ghost commented Dec 16, 2021

Copy link
Copy Markdown

🎉v7.3.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

TrapGodBrim pushed a commit to TrapGodBrim/PowerShell that referenced this pull request Jan 19, 2022
…ecific cases (PowerShell#16029)

If Move fails, check if known case before attempting CopyAndDelete:

- if an item is attempted to be renamed across filesystem mount boundaries.
- if the source and destination do not have the same root path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.2.x-Done CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recent Move-Item changes causing Windows platform regressions

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.