Repository navigation
fix(tool): distinguish directories from missing files in file_read - #2171
Open
lizhengfeng101 wants to merge 3 commits into
Open
lizhengfeng101 wants to merge 3 commits into
lizhengfeng101 wants to merge 3 commits into
Conversation
Contributor
|
OpenCodeReview · Complete review: 3 of 3 selected files covered 0 findings. Review infoReviewed commits:
|
9 of 15 tasks
This branch has not been deployed
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.
Description
file_readused to label workspace directory reads as missing and display a Git tree listing as numbered file contents. It now rejects directories on either comparison side. Compatibility change: reading a directory at a Git revision no longer lists its entries.A missing-path error identifies the working tree or revision in which the path was checked. Inspection failures retain their own diagnostics. Directory and missing-path calls remain visible as unsuccessful, but repeating them does not consume the consecutive-failure allowance or hide the original reason.
Ordinary committed files still take one Git command to read, including empty files. The tools reference and error example are updated in all six published documentation languages.
How Has This Been Tested?
make checkandmake test(including the race detector).GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build ./internal/toolverifies that the workspace path handling compiles for Windows.AI Assistance
OpenAI Codex CLI (
gpt-6.2-astra) assisted with implementation, tests, documentation and PR preparation. OpenCodeReview (gpt-6.2-astra) reviewed the three selected production Go files before commit.Review Notes
Regression tests cover two cases found in pre-commit review: the root of the synthetic empty tree (
.or./) is a directory, and a workspace path beneath a regular file is missing. The latter is classified only after checking the repository boundary.The review also noted that a Git submodule entry and a workspace named pipe are not regular files or Git trees. They still follow the generic failure-streak handling; this change does not introduce a new policy for special file types.
Closes #2170.