Repository navigation
Preserve destinations when receiving a symlink fails - #10954
Merged
kovidgoyal merged 1 commit intoNov 27, 2026
Merged
kovidgoyal merged 1 commit into
kovidgoyal merged 1 commit into
Conversation
Use the atomic symlink helper for incoming transfer links so a failed replacement preserves the existing destination. Use a short temporary basename so replacing a destination with a maximum-length name also works.
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.
Summary
Preserve an existing destination when the transfer kitten cannot create a received symbolic link. Use the existing atomic symlink helper to create the replacement before renaming it into place.
Use a short temporary basename in the destination directory so valid names at the filesystem limit remain replaceable. An incoming link that conflicts with an existing directory now leaves that directory in place.
Evidence
tools/utilsandkittens/sshtests passed with their login-shell and shared-memory cases rerun outside the sandbox.go vet -tags testing ./kittens/transfer ./tools/utils,gofmt -s, andgit diff --checkpassed.