Indexing a tree by path yields different result with trailing slash
還沒有人認領這個 Issue。
評估
研究方向
使用提供的 TreeDefinition 和樹索引器範例重現此差異,比較針對 "some/deeply/" 和 "some/deeply" 回傳的路徑。追蹤已索引子樹的 TreeEntry 路徑建構,並新增一個涵蓋這兩個輸入的回歸測試。當帶有結尾斜線的索引會回傳與不帶斜線的等效路徑相同的非重複路徑時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
When a slash is included when indexing into a tree to a subtree, the resulting TreeEntry has a path with a duplicated last path part.
using System.Text;
using LibGit2Sharp;
var path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
using var repo = new Repository(Repository.Init(path, isBare: true));
var bytes = Encoding.UTF8.GetBytes("Hello, World!");
var blob = repo.ObjectDatabase.CreateBlob(new MemoryStream(bytes));
var td = new TreeDefinition();
td.Add("some/deeply/nested/file", blob, Mode.NonExecutableFile);
var tree = repo.ObjectDatabase.CreateTree(td);
var withSlash = tree["some/deeply/"].Path;
var withoutSlash = tree["some/deeply"].Path;
Console.WriteLine(withSlash); // some/deeply/deeply
Console.WriteLine(withoutSlash); // some/deeply
I was seeing this across Linux and Windows, on versions 0.31 and 0.32 and .NET 10 and Framework 4.8
- 主要語言
- C#
- 星號
- 3.5k
- 分支
- 925
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
libgit2/libgit2sharp 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 52/100
libgit2/libgit2sharp#2193 · 2 則留言 ·
-
難度 4/5 3-5 天 新手友好度 38/100
libgit2/libgit2sharp#2192 · 1 則留言 ·
-
Website is down 未關閉
難度 4/5 3-5 天 新手友好度 20/100
libgit2/libgit2sharp#2191 · 2 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 35/100
libgit2/libgit2sharp#2187 · 2 則留言 ·
-
難度 3/5 1-2 天 新手友好度 48/100
libgit2/libgit2sharp#2184 · 1 則留言 ·
查看 libgit2/libgit2sharp 的全部 Issue
相似的 Issue
-
Status: Waiting triage Type: Bug
難度 2/5 1-3 小時 新手友好度 84/100
nanoframework/Home#1857 ·
-
kind/bug kind/regression
難度 2/5 1-3 小時 新手友好度 78/100
unoplatform/uno.toolkit.ui#1646 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
nightscout/nocturne#1379 ·
-
難度 2/5 1-3 小時 新手友好度 86/100
elastic/esql-dotnet#47 ·
-
難度 1/5 1 小時以內 新手友好度 85/100