Let's keep libgit2 out of the picture. It's not like upstream will use libgit2. Ever.

As to threading issues: if that were the case, then upstream's static buffer would already have a problem. Apparently, they don't, though.

In any case, let's not conflate issues. If you want to make that function thread safe, please craft an independent patch series and send it upstream (because it has nothing Windows-specific to it).

Let's keep this here pull request exclusively to the minimal diff necessary to support reparse points. Its diff is *huge* enough already (not easy to set aside enough time to review, for sure).