libgit2/libgit2 — pull request #993 by pwkelley (2012-10-18 19:07:45+00:00)
Title: Update clar and add reliable rename for Win32

This change updates clar to latest bits and adds a new function to the test infrastructure called `cl_rename` which, on UNIX platforms, just calls `p_rename`. On Win32, though, it adds retry logic around a call to `MoveFile`.

This adds additional resiliency when renaming the `.gitted` directory to `.git`, etc. during test setup. If the machine on which tests are running has anti-virus software installed, then the anti-virus may still be scanning the (newly-created) `.gitted` directory at the time of the rename attempt, resulting in a failure with error `ERROR_ACCESS_DENIED`. Retry is the only real way to improve reliability in the face of this problem.

On my machine, I have been encountering rename failures due to antivirus contention about 1 in 40 executions of the entire test suite (or about 1 in 25,000 individual test executions). After this change, I ran 160 iterations of the test suite (about 100,000 individual test executions) and did not observe the problem.

This change only affects test infrastructure, and does not change how libgit2 performs renames on Win32 in general.

The reason for the clar update is to improve performance of the test suite on Win32 by about 4x.