libgit2/libgit2sharp — Issue #118: Committing files in nested folders throws exception.
Author: nmartin867
Created: 2012-02-29 15:03:01+00:00
State: open

I am running into an issue when I add/commit files to a GIT repository that are not at the root level. My application is attempting to check in a group of files into the GIT repository in a name-spaced folder structure. For example if I begin with an empty repository directories are create like so:

mygitfolder.git
|
|__1.0
|
|__local
|
|__somefile.js

As the process begins everything seems to work great. But after about 4-5 commits I get an exception thrown by libgit2:

An error was raised by libgit2. Error code = GIT_EOSERR (-5).
Failed to create tree
- Failed to write tree to db
- Failed to write tree
- Failed to write object
- Failed to open write stream
- Failed to create loose backend stream
- Failed to open file buffer for 'c:/temp/git/.git/objects/tmp_object'
- Failed to create temporary file

If I comment out code where folders are being created on the fly and just lay the files down in the root, no exception is thrown. e.g.

mygitfolder.git
file1.js
file2.js
file3.js
...

Is this a known issue? Or should I be somehow be creating the folders within libgit2sharp before attempting to commit? It seems odd that it should work for the first 4-5 commits however.