Serialize commit in order expected by cgit

Cgit will complain about "bogus" object files unless the commit object respects the correct order defined at: http://git.rsbx.net/Documents/Git_Data_Formats.txt

This patch enforces that order. I am able to clone a virtual repo with this patch but not without.