Repository navigation
fix: preserve literal paths in Glob - #665
Merged
Merged
Conversation
Collaborator
|
Please do not use I’m recommending the use of |
hoobnn
force-pushed
the
fix/glob-literal-paths
branch
from
October 7, 2026 21:55
37560f0 to
681938c
Compare
hoobnn
force-pushed
the
fix/glob-literal-paths
branch
from
October 20, 2026 02:24
681938c to
f57bc63
Compare
Contributor
Author
|
Thanks for the pointer. I've replaced the |
puellanivis
reviewed
Oct 23, 2026
Assisted-by: Codex:gpt-6.1-sol Assisted-by: Claude:claude-opus-5-5
hoobnn
force-pushed
the
fix/glob-literal-paths
branch
from
October 25, 2026 14:44
f57bc63 to
a30b8fb
Compare
puellanivis
reviewed
Oct 26, 2026
Assisted-by: Claude:claude-opus-5-5
puellanivis
approved these changes
Oct 26, 2026
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 #531.
For an existing directory,
Client.Glob("/home/")currently returns/home/home. The literal-path branch rebuilds the result from the split pattern and FileInfo.Name(), duplicating the final component when the pattern ends in a slash.Return the original pattern after Lstat confirms it exists. This matches
path/filepath.Glob, which returns the pattern unchanged in this case, as noted in the issue. This also preserves leading./,./..elements and repeated separators. Wildcard patterns are unaffected.The new test runs a client against an in-memory RequestServer over net.Pipe. 7 of its 12 literal-path cases fail without this change.
Tested on macOS (Go 1.27.1):
go test -race ./..., plus the existing Glob integration tests against OpenSSH's sftp-server.I used OpenAI Codex and Claude Code to investigate the issue, write the fix and tests, and run the checks. I reviewed the code and this description myself.
Assisted by Claude Code