libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.13k stars 879 forks source link

LibGit2Sharp.NotFoundException: 'could not find 'file' to stat: The system cannot find the file specified. #1992

Closed marcusdias93 closed 1 year ago

marcusdias93 commented 1 year ago

I'm having a exception when trying to clone a repository, change and than commit. I tried use the command "fetch --unshallow" after cloning, but it didn't work.

LibGit2Sharp.NotFoundException: 'could not find 'D:/Testclone/clshifts1.dat' to stat: The system cannot find the file specified.

The exception is in this line Repository.Index.Add(item); for a file that is missing.

stack trace:

at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) at LibGit2Sharp.Core.Proxy.git_index_add_bypath(IndexHandle index, FilePath path) at LibGit2Sharp.Index.Add(String pathInTheWorkdir)

I'm using the version 0.26.0.0 and .NET Framework 4.6.1. Windows 10 image

marcusdias93 commented 1 year ago

I didn't know that I should remove the missing files instead of updating them in the index.

image