write-yourself-a-git icon indicating copy to clipboard operation
write-yourself-a-git copied to clipboard

[Question] file mode in tree object

Open iTakeshi opened this issue 6 years ago • 2 comments

In the section 6.2 in the blog article it says [mode] is up to six bytes, and the code includes an assertion that checks the length of mode is 5 or 6 characters.

I'm finding for references which indicate the mode can be 5-chars, but it seems everyone assumes it is 6-chars. Could you please provide any detailed references for the mode string format?

iTakeshi avatar Mar 26 '19 13:03 iTakeshi

Directory modes are stored as five bytes even though ´ls-tree´ pads them to 6. I'll add a note to clarify this, thanks!

thblt avatar Mar 27 '19 11:03 thblt

I've just checked it with git ls-tree. Thanks for your reply (as well as your outstanding educational contribution in this project) !

iTakeshi avatar Mar 27 '19 14:03 iTakeshi