我有一个小项目用于更新 GitHub 存储库中的各种设置。虽然我找到了 repo,但 Edit 方法会抛出 NotFoundException。有什么建议可能是错的吗?我正在从“大师”变为“开发”,两者都存在。
public async Task<Repository> SetDefaultBranch(string repository, string branch)
{
//var repo = await _client.Repository.Get(_owner, update.Name);
// the repo is found, but afterwards I receive NotFoundException on Edit
var update = new RepositoryUpdate(repository) { DefaultBranch = branch };
return await _client.Repository.Edit(_owner, repository, update);
}