Btw, this is something I added in a single commit - moving away from the thread-unsafe version to the thread-safe version: https://github.com/msysgit/git/commit/b1a583f126e169e24a266779a834e42c0d1a6735

I did this deliberately as a separate commit as it was modifying somebody else's work, and because there is probably a long way to go to make this code thread-safe.