Support "weird" permissions in directories
Many git directories have permissions "040000" instead of "40000".
It's also possible there are other types of weird permissions non-octal or longer than 6 octal digits permissions (though I have not seen any yet)
We should be able to store them.
Migrated from T3596 (view on Phabricator)