Repository navigation
Preserve empty directories in mcli mirror - #83
Merged
Merged
Conversation
Signed-off-by: Chen Shi <chenshi5012@163.com>
Signed-off-by: Feng Ruohang <rh@vonng.com>
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 #80. Integrates Chen Shi’s original commit from #81 and a signed-off maintainer follow-up. The initial mirror scan maps empty local directories to zero-byte keys ending in a slash. A zero-byte regular file keeps its original key.
The filesystem scan uses object-key order, follows symlinks to regular files, and propagates listing errors to the command’s exit status. With
--remove, an existing local directory that will receive a child keeps its identity and permissions. Remote objects ending in a slash use the existing S3 transfer path so their payload and headers survive cross-alias copies.Ordinary recursive listings and
mcli diffkeep their existing file-list behavior. The--watchhelp describes when the local scan includes empty directories.Regression coverage exercises the CLI for unreadable directories, symlinks with
--remove, target parent retention, anddiff. The SILO functional suite covers an empty-directory round trip, zero-byte regular files, and cross-alias transfers of slash-ending keys with payload and metadata.Validated on macOS arm64 with Go 1.27.4 and
pgsty/silo@d66020003. The full SILO functional suite passed, including the new marker test. In a versioned bucket, mirroring the symlink fixture with--removekept the original file version and its metadata. A local target parent kept its inode and mode while receiving its first child. The Windows amd64 test binary and Linux amd64 client cross-compiled. The SILO server built against the candidate, and the Console object-list tests passed with the candidate selected.GitHub rejected a Go workflow dispatch for this repository with HTTP 422 (“Actions has been disabled for this repository”). The validation above was run locally. The bilingual command reference update is pgsty/silo.pgsty.com#62.
On the final commit,
go test -race -count=1 ./...,go vet ./..., the repository lint configuration,make install, dependency floors, branding, credits and release-state checks all passed.