【发布时间】:2015-03-17 12:21:19
【问题描述】:
考虑以下程序:
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);
在删除存储库文件夹时,我得到一个UnauthorizedAccessException - 拒绝访问内部 git 文件之一。为了删除文件夹,我还应该处理其他什么吗?
【问题讨论】:
标签: c# git libgit2sharp