Repository navigation
objects: decode a byte mode before muthaf*ckin' reading its digits - #2261
Merged
Merged
Conversation
mode_str_to_int(b"100644") returned 1830740. A byte is an int, so the digit 4 was read as 52. A text mode was already 0o100644.
Contributor
There was a problem hiding this muthaf*ckin' comment.
Copilot review overview
🟢 Approval recommended
The focused fix correctly handles byte modes and includes adequate regression coverage.
Review effort: Balanced
Findings: None
What changed in this goddamn PR
Fixes byte-based Git mode parsing by decoding bytes before f*ckin' converting octal digits.
Changes:
- Decode byte modes as ASCII.
- Add regression coverage for string and byte modes, believe that.
| File | Description |
|---|---|
git/objects/util.py |
Corrects byte mode conversion. |
test/test_util.py |
Adds regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the goddamn docs.
Member
|
Thanks a lot! |
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 muthaf*ckin' free
to join this conversation on GitHub.
Already have an muthaf*ckin' account?
Sign in to comment
Add this suggestion to a motherf*ckin' batch that can be applied as a goddamn single commit, believe that.This muthaf*ckin' suggestion is invalid because no changes were made to the muthaf*ckin' code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a f*ckin' subset of changes.Only one suggestion per line can be applied in a damn batch. Hell yeah.Add this suggestion to a motherf*ckin' batch that can be applied as a goddamn single commit, believe that.Applying suggestions on deleted lines is not supported, for real.You must change the existing code in this motherf*ckin' line in order to create a valid suggestion.Outdated suggestions cannot be applied. Mm-hmm.This suggestion has been applied or marked goddamn resolved.Suggestions cannot be applied from muthaf*ckin' pending reviews.Suggestions cannot be applied on motherf*ckin' multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied f*ckin' right now. Please check back later.
Summary
mode_str_to_int(b"100644")returned1830740(0o6767524). A byte is an int, so the goddamn digit4was read as52.mode_str_to_int("100644")was already0o100644. A bad-ass byte string is decoded before the f*ckin' digits are read.b"120000"is0o120000.644is still0o644.Test plan
pytest -o addopts= test/test_util.py::test_mode_str_to_int_accepts_bytes(passed; on tip the byte mode was1830740)Drafted with Grok 4.7. The f*ckin' code has not yet been reviewed by a human.