Repository navigation
fix: keep a copied project out of the original's directory when their sanitized names collide - #752
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
… sanitized names collide A copy that keeps the local-id of its original was matched by local id to the original's directory, so the push moved the copy inside it and assigned the new cloud id to the original. Only the pushed project's own directory may be matched by local id now.
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.
Fixes #740
When a project without a cloud ID is pushed,
get_local_project_pathlooks for its destination directory and accepts any existing directory whoselocal-idmatches. A copy of a project keeps thelocal-idof its original, so if sanitizing the copy's name selects the original's directory, that directory is taken as the destination.shutil.movethen nests the copy inside it, the push reads the original's config, assigns the new cloud ID to it, and uploads the original's files.The local-id match is now limited to the pushed project's own directory (
source_path). A different directory that merely shares the local ID is treated as taken, and the next free name (Python Project 2) is used, so both projects keep their contents and cloud IDs.Test: a copy
Python:Projectsharing the local ID ofPython Project(cloud ID 10) is pushed. It fails before the change (the original's cloud ID becomes 20) and passes after; it also checks that the original's files are unchanged and that the copy's own files are uploaded to project 20.This change was prepared with assistance from an AI coding tool.