LibGit2Sharp Index Locked - Error

Sometimes I try to read and write to the Git repository at the same time. But after that, I get the following error message when I try to commit files:

The error was caused by libgit2. Category = Index (LockedFile). the index is locked. This may be due to the end or failure of the process.

The end is fulfilling, as expected, why am I getting this error message? How can I get rid of it?

(If the LibGit2Sharp developer sees this: there is an error in the error message: concuRRRent.): D

+7
git github versioning libgit2 libgit2sharp
source share
2 answers

An index is a gateway channel between a git object database and a working directory. It is used when creating a commit (i.e., setting, non-stationary, ..) or when checking files. Thus, performing these operations at the same time can cause such errors, since both operations will chase access to the index.

Some work is done at the libgit2 level to use the index better for streaming read operations (see libgit2 / libgit2 # 2108 ).

However, depending on the type of read / write operations you perform, you may not need to go through the index:

  • For example, navigating through Commit, Tree or retrieving Blob content will not use the index.
  • You can also create Blobs, Trees, and Commits without going through the index, directly inserting objects into the object databases (see this https://stackoverflow.com/a/125857/ for quick start).

If the LibGit2Sharp developer sees this: there is a spelling error in the error message: concuRRRent.

Good booty! Would you like to open a Pull request to help us fix this ?; -)

+5
source share

Dropbox may also interfere with git operations. I pause Dropbox sync before any git sync.

+8
source share

All Articles