scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 91 forks source link

Invalid commits created when username is non-ascii #152

Closed gazpachoking closed 7 years ago

gazpachoking commented 7 years ago

I noticed a problem which happens when the user editing the wiki has non-ascii characters in their name. Everything works fine directly in realms, but the commit objects in the git repo don't get hashed correctly, and the git cli tools choke on the repo depending on what you are trying to do. If you run git fsck you can see error: sha1 mismatch for any such commit objects. The solution seems to be to encode any unicode to utf-8 bytes before passing it to gittle.commit. I feel like gittle should be responsible for this, as it claims to be 'for humans', but I might make a fix here for now.