The spec in Chapter 5.3 states that directories should use '040000' for normalized access rights, but the actual serialization uses "40000" (5 ASCII bytes) without the leading zero.
From the spec (line 61):
the normalized access rights, encoded as a sequence of ASCII-encoded octal digits ('100644' for regular [i.e., non-special] files, '100755' for executable files, '120000' for symbolic links, and '040000' for directories)
However, Git's tree object format stores this as the ASCII string "40000" (5 bytes: 34 30 30 30 30), not "040000" (6 bytes).
This caused confusion while implementing the Ruby library (https://github.com/andrew/swhid) as the notation suggests 6 characters when only 5 should be serialized.
Suggest clarifying that while the octal value is 040000, the serialization uses minimal ASCII representation without unnecessary leading zeros (same as Git).
The spec in Chapter 5.3 states that directories should use
'040000'for normalized access rights, but the actual serialization uses"40000"(5 ASCII bytes) without the leading zero.From the spec (line 61):
However, Git's tree object format stores this as the ASCII string
"40000"(5 bytes:34 30 30 30 30), not"040000"(6 bytes).This caused confusion while implementing the Ruby library (https://github.com/andrew/swhid) as the notation suggests 6 characters when only 5 should be serialized.
Suggest clarifying that while the octal value is 040000, the serialization uses minimal ASCII representation without unnecessary leading zeros (same as Git).