But second, there was a TOCTOU race in updating. In order to fix
this, I first tried to use existing NodeGit methods, but they call
into a function of libgit2 which didn't support asserting that a ref
was new. I filed a PR against libgit2 to fix this, but of course it
will take some time to get merged. So in the meantime, we shell out
to git.
First, add retries.
But second, there was a TOCTOU race in updating. In order to fix this, I first tried to use existing NodeGit methods, but they call into a function of libgit2 which didn't support asserting that a ref was new. I filed a PR against libgit2 to fix this, but of course it will take some time to get merged. So in the meantime, we shell out to git.