libgit2 / libgit2/libgit2sharp

GitRepo.Commits.QueryBy(fpath) fails with "Given key not present in dictionary" for some folders only on master branch!

未關閉
#1,520 5 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

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

描述

I use this code:

GitRepo = new Repository(Repository.Discover(SolutionDir));

string fpath = folder.Replace(SolutionDir, string.Empty).Replace("\", "/").TrimStart('/');

        foreach (var c in GitRepo.Commits.QueryBy(fpath).Take(1))
        {
            revisionsList.Add(folder.Split(Path.DirectorySeparatorChar).Last(), c.Commit.Committer.When.ToUnixTimeSeconds());
        }

The GitRepo.Commits.QueryBy(fpath) fails for some folders on master branch and only on master.

It works fine when you run it of a branch made from master.

I tried to get back the version of the library and found this code works in v0.22.1 from nuget.

It fails for 0.23.0, 0.23.1, 0.24.0 - all tested to fail.

If you can fix it in 0.24.1 will be great.

Thanks,

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從 GitRepo.Commits.QueryBy(fpath) 開始,在 master 上為受影響的資料夾重現字典例外,並與從 master 建立的分支進行比較。比較 v0.22.1 與 v0.23.0–v0.24.0 之間的行為;當相同路徑在 master 上不再失敗且仍回傳預期的 commit 資料時,即視為完成。

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

評估

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

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

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