Skip to content

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented Mar 25, 2025

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

fix: error out when the source and destination might be subdirectories of each other
fix #5170

Motivation and Context

How to test this PR?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

@jiuker jiuker changed the title fix: error out source and target are the same for mv fix: error out when source and target are the same for mv Mar 25, 2025
@jiuker jiuker requested a review from shtripat March 26, 2025 02:27
@jiuker jiuker changed the title fix: error out when source and target are the same for mv fix: error out when the source and destination might be subdirectories of each other Mar 26, 2025
@jiuker jiuker force-pushed the fix-error-out-when-source-and-target-url-are-the-same-for-mv branch from ae24818 to abec01a Compare March 26, 2025 02:52
Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

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

The check that you added fails for situations like

mc mv /tmp/file.tmp /tmp/file

@jiuker jiuker requested a review from harshavardhana March 26, 2025 07:15
@jiuker jiuker force-pushed the fix-error-out-when-source-and-target-url-are-the-same-for-mv branch 2 times, most recently from 422af5f to bc455da Compare March 26, 2025 07:46
@jiuker
Copy link
Contributor Author

jiuker commented Mar 28, 2025

@shtripat @harshavardhana Need this to fix linter.

@harshavardhana
Copy link
Member

@jiuker will send a separate PR for that from miniohq/ec

…each other

error out when the source and destination might be subdirectories of each other
@jiuker jiuker force-pushed the fix-error-out-when-source-and-target-url-are-the-same-for-mv branch from f0ecdde to 8c9cd37 Compare March 28, 2025 08:31
ut
ut
@jiuker jiuker requested a review from ramondeklein April 1, 2025 09:17
jiuker added 2 commits April 1, 2025 17:20
lint
remove doc
Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

No need for being unclear in the error.

Co-authored-by: Klaus Post <klauspost@gmail.com>
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

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

lgtm

@harshavardhana harshavardhana merged commit 2d305ce into minio:master Apr 2, 2025
5 checks passed
dyakovri added a commit to mc-actions/publish that referenced this pull request Apr 13, 2025
mv dir to dir/subdir not not supported minio/mc#5173

todo: make a content backup durung uploading
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.

mc mv command on same bucket delete file
5 participants