Closed gmkado closed 3 years ago
Cake.Git 1.0.1 was released already in March 2021, therefore this can't be related to an update of Cake.Git.
You mention it worked last week. What have you changed? Have you updated the addin or Cake? Have you pinned addin and Cake version? Did you run any OS updates? Do you get the error while running it on the same repository as last week? Do you get the same error on other repositories?
Thanks for the quick response! It looks like there were some security updates that ran yesterday
I did not get the error running on the same repository last week. I also get the same error for other repositories. I didn't touch the cake script at all for either repos.
Also this is how I reference the addin:
#addin nuget:?package=Cake.Git&version=1.0.1
Looks like these might be related: https://github.com/libgit2/libgit2sharp/issues/1711
I'm not using this through cake, but I'm using libgit2sharp directly. I also have this issue that since last week suddenly access violations happen when calling RetrieveStatus() of libgit.
public bool HasUncommittedChanges()
{
using (var git = new Repository(Directory.FullName))
{
return git.RetrieveStatus().IsDirty;
}
}
As you can see, not much happening here on my part. It just dies. If you find any solution or workaround I'd be interested to know.
FY, we're seeing the same error when running integration tests via CI of this addin:
========================================
Git-HasUncommitedChanges-Dirty
========================================
Checking if repository has uncommited changes...
C:\projects\cake-git\tools\Cake\Cake.exe : Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
At line:1 char:1
+ C:\projects\cake-git\tools\Cake\Cake.exe "build.cake" --target="AppVe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Fatal error. Sy...ory is corrupt.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
https://ci.appveyor.com/project/cakecontrib/cake-git/builds/40242817#L702
It looks like updating to the latest LibGit2Sharp 0.27.0-preview fixes the issue https://github.com/libgit2/libgit2sharp/issues/1711#issuecomment-868286918
@gmkado @Xcone This has been fixed with Cake.Git v1.1.0
#addin "nuget:?package=Cake.Git&version=1.1.0"
This was working fine last week, not sure what changed, but calling GitHasUncommitedChanges on v1.0.1 throws the following exception: