fix: Replace files instead of creating duplicates in package_update #247
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.
Summary
Fixes the behavior where
package_update()would create numbered duplicates (1_file.txt,2_file.txt) when updating files at the same logical path.Problem
The previous implementation treated Quilt packages as if they needed collision avoidance within a single version. When updating a package with a file that already existed at a logical path, it would:
data.csv)1_data.csv)2_data.csv,3_data.csv)This behavior is incorrect because Quilt packages are versioned - each push creates a new version with a unique
top_hash.Solution
Files at the same logical path now replace the existing file in the new version. The old file remains accessible in the previous package version through package history.
This aligns with how versioned package systems should work:
1_file.txt,2_file.txtduplicatesChanges
_collect_objects_into_package()Testing
All existing tests pass, including:
test_collect_objects_with_duplicate_logical_paths- Updated to verify replacement🤖 Generated with Claude Code