read_code with rev rejects a valid git path when its parent directory no longer exists in the working tree #568
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#568
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in worker dogfooding (triage round 14), reproduced on the installed v0.41.48.
Reproduction (in a checkout where
crates/cli/tests/fixtures/was deleted after commit94a577fa):Actual:
path_outside_root; the hint rejects absolute or..components, although the path has neither.Control:
git cat-file -e 94a577fa:crates/cli/tests/fixtures/legacy-verdict.tomlexits 0. A historical read of a sibling file whose directory still exists succeeds and reportsresolved_commit.Expected: a
revread validates the project-relative path lexically and reads the git blob, independent of whether the parent directory exists in the working tree.Impact: a reviewer cannot read a file from a deleted directory through the historical reader, which is the case
revexists for. Related: #558, #555.Released in v0.41.50:
read_codewithrevreads a path whose directory no longer exists in the working tree.Verified on the installed binary (
code-index 0.41.50 (3d0a584c)): after removingsrc/from a committed fixture,read_code {"target":"src/lib.rs:1-3","rev":"HEAD"}returns the committed lines. Closing.path_outside_rootfor a missing file whose directory does not exist #578