libgit2 / libgit2/libgit2sharp
FullHistory method of FileHistory class, doesn't return actual history
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 3.5k
- 分支
- 925
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Code:
var _repository = new Repository(@"D:\11");
var commitFilter = new CommitFilter { SortBy = CommitSortStrategies.Topological };
var sdf = _repository.Commits.QueryBy("SPF 711 performance", commitFilter).Select(c => c.Commit).ToList();
doesn't return history, while existing of 7 commits.

Inside the method FullHistory iterating through commits stops when reaching commit
4bf4edccaa9ce3b7f785b14939a3545c627b5dfd because of this code:
var currentTreeEntry = currentCommit.Tree[currentPath];
if (currentTreeEntry == null)
{
yield break;
}
looks like iterator cannot achieve commits which contain a history of the file because of the running into the commit which knows nothing about the file.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
找到 FileHistory.FullHistory,並使用所示的 Repository 和 CommitFilter 在包含七個 commit 的歷史中重現問題。追蹤 commit 4bf4edccaa9ce3b7f785b14939a3545c627b5dfd 處的迭代,並確認該方法會傳回完整的檔案歷史,而不是在 currentTreeEntry 為 null 時停止。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp, git
- 領域
- devtools
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100