The index is a gateway channel between the git object database and the working directory. It's used when crafting a commit (ie. staging, unstaging, ..) or when checking out files. Thus performing those operations concurrently may raise such kind of errors as both operations will race to gain access to the index.
Some work in being done at the libgit2 level to make usage of the index a better experience for threaded read operations (See libgit2/libgit2#2108 for instance).
However, depending on the kind of read/write operations that you perform, you may not need to go through the index:
- For instance, navigating a Commit, a Tree or retrieving the content of a Blob won't leverage the index.
- You may also create Blobs, Trees and Commits without going through the index, by directly inserting objects in the object databases (See this StackOverflow answer for a quick start).
If a LibGit2Sharp developer sees this: There is a Spelling mistake in the error message: concuRRRent.
Good catch! Would you feel like opening a Pull request to help us fix this? ;-)