libgit2 / libgit2/libgit2sharp

"invalid version 0 on git_proxy_options" thrown when natives are built from source

未關閉
#2,161 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C#
星號
3.5k
分支
925
PR 合併指標
30 天內沒有已合併 PR

描述

Hi, I'm currently trying to make a custom build that uses libssh2 instead of exec for SSH, since I don't want OpenSSH windows to spawn as my program makes requests. I changed this flag, then followed through the rest of the compilation steps both for native binaries and lg2s.

I then tried pulling, not on a proxy, using this code:

var fOptions = new FetchOptions ();
fOptions.Prune = UpdaterMod.settings.pruneOld;

var mOptions = new MergeOptions ();
mOptions.CommitOnSuccess = true;
mOptions.FileConflictStrategy = UpdaterMod.settings.onFileConflict;

var sig = new Signature (new Identity (modName, email), DateTimeOffset.Now);

try {
    string logHolder = "";
    Commands.Fetch (repo, remote.Name, refSpecs, fOptions, logHolder);

    if (logHolder.Length > 0)
        LogMsg (logHolder, LogMode.Warn);
}
catch (Exception e) {
    LogMsg ($"Could not fetch data from remote repo: {e.Message}", LogMode.Error);
    return;
}

Expected behavior

The program should attempt to pull without trying to use a proxy.

Actual behavior

The caught exception contains the message in the title.

System information

Windows 10 10.0.19045

AMD Ryzen 5 3600

Other useful information

This issue persists when the flag is switched back to exec

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從報告中的 Windows 建置版本上的 Commands.Fetch 呼叫(使用 FetchOptions)開始,然後追蹤 native 建置如何處理 Proxy 選項和版本驗證。使用 custom 和 exec 設定重現 fetch;當不使用 Proxy 的 fetch 不再拋出所報告的無效版本例外時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, git
領域
tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。