Skip to content

Preserve tree entry names across buffer refills - #5

Merged
andrew merged 1 commit into
mainfrom
fix/tree-entry-buffer
Sep 21, 2026
Merged

andrew merged 1 commit into
mainfrom
fix/tree-entry-buffer

Conversation

@andrew

@andrew andrew commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

WalkTreeEntries can corrupt a filename when Peek refills the reader buffer after ReadSlice returns the name. This breaks the documented filename lifetime and causes git-spdx scans of larger trees to fail with invalid paths.

Copy the name only when the object ID read requires a buffer refill. Add regression coverage that compares every name, hash, and mode with git ls-tree for 1,100-file SHA-1 and SHA-256 trees in loose and packed storage.

@andrew
andrew merged commit 2736818 into main Sep 21, 2026
4 checks passed
@andrew
andrew deleted the fix/tree-entry-buffer branch September 21, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant