thblt / write-yourself-a-git

Learn Git by reimplementing it from scratch

Home Page:https://wyag.thb.lt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing trees may cause a bug?

qianqianShallow opened this issue · comments

hello, the current code in def tree_parse_one(raw, start=0) as followed:

sha = hex(
       int.from_bytes(
           raw[y+1:y+21], "big"))[2:] 

but if sha have a leading 0,it may cause a bug?

My mistake, this was fixed in e306292, but the fix hasn't been uploaded. Thanks!

Sorry, i did not notice it! I found the code in a blog and the code in blog seem not be updated. However, the code is very helpful for me, it help me understand the git, thanks!

I found the code in a blog and the code in blog seem not be updated.

It should be now!