Raf*_*fal 4 c# git libgit2sharp
考虑以下计划:
var path = Path.Combine(
Path.GetTempPath(),
Path.GetFileNameWithoutExtension(Path.GetRandomFileName()));
Directory.CreateDirectory(path);
var testFile = Path.Combine(path, "test.txt");
File.WriteAllText(testFile, "Test file");
var source = Repository.Init(path);
using (var repository = new Repository(source))
{
repository.Index.Add("test.txt");
}
Directory.Delete(path, true);
Run Code Online (Sandbox Code Playgroud)
在删除存储库文件夹时,我得到了UnauthorizedAccessException
- 拒绝访问其中一个内部git文件.为了删除文件夹,还有什么我应该处理的吗?