libgit2 / libgit2/libgit2sharp
"Too many redirects or authentication replays" when pushing changes
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 3.5k
- 分支
- 925
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Hi,
have been search for this for a day and some people mentioned it is a bug.
I can clone, stage and commit, but the push always fails.
Command line push works fine
ClonedRepoPath = @"c:\temp\test"
_params.ClonedRepoPath = "http://172.16.40.129/test/Interfaces.git"
clone:
` if (!Directory.Exists(_params.ClonedRepoPath))
{
Directory.CreateDirectory(_params.ClonedRepoPath);
}
var result = Repository.Clone(_params.ServerPath, _params.ClonedRepoPath);
`
stage, commit and push
`
using (var repo = new Repository(_params.ClonedRepoPath))
{
if (repo.Network.Remotes.All(r => r.Name != name))
{
repo.Network.Remotes.Add(name, _params.ServerPath);
}
Commands.Stage(repo, "*");
if (repo.RetrieveStatus().IsDirty)
{
Commit commit = repo.Commit("CodeGen commit", new Signature(_params.UserName, _params.EmailAddress, System.DateTimeOffset.Now)
, new Signature(_params.UserName, _params.EmailAddress, System.DateTimeOffset.Now));
var options = new PushOptions{
CredentialsProvider = (_url, _user, _cred) => new DefaultCredentials()
};
repo.Network.Push(repo.Network.Remotes["origin"], @"refs/heads/master", options);
}
}
`
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
未指定任何儲存庫檔案或測試。請從報告中顯示的 Push 呼叫和 PushOptions/CredentialsProvider 開始,然後將其驗證設定與成功的命令列 push 進行比較。完成的標準是重現該失敗,並找出使程式庫 push 成功的設定或程式碼變更。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp, git
- 領域
- networking, tooling
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100