Title: Indexing a tree by path yields different result with trailing slash · Issue #2189 · libgit2/libgit2sharp · GitHub
Open Graph Title: Indexing a tree by path yields different result with trailing slash · Issue #2189 · libgit2/libgit2sharp
X Title: Indexing a tree by path yields different result with trailing slash · Issue #2189 · libgit2/libgit2sharp
Description: 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().ToStr...
Open Graph Description: 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(...
X Description: 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(...
Opengraph URL: https://github.com/libgit2/libgit2sharp/issues/2189
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Indexing a tree by path yields different result with trailing slash","articleBody":"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. \n\n```csharp\nusing System.Text;\nusing LibGit2Sharp;\n\nvar path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n\nusing var repo = new Repository(Repository.Init(path, isBare: true));\n\nvar bytes = Encoding.UTF8.GetBytes(\"Hello, World!\");\n\nvar blob = repo.ObjectDatabase.CreateBlob(new MemoryStream(bytes));\n\nvar td = new TreeDefinition();\ntd.Add(\"some/deeply/nested/file\", blob, Mode.NonExecutableFile);\n\nvar tree = repo.ObjectDatabase.CreateTree(td);\n\nvar withSlash = tree[\"some/deeply/\"].Path;\nvar withoutSlash = tree[\"some/deeply\"].Path;\n\nConsole.WriteLine(withSlash); // some/deeply/deeply\nConsole.WriteLine(withoutSlash); // some/deeply\n```\n\nI was seeing this across Linux and Windows, on versions 0.31 and 0.32 and .NET 10 and Framework 4.8","author":{"url":"https://github.com/mburtka","@type":"Person","name":"mburtka"},"datePublished":"2026-08-04T21:03:16Z","url":"https://github.com/libgit2/libgit2sharp/issues/2189"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:92b1e08d-0342-f960-d622-59f3d1819519 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAB2:B4351:D6ACA:13BF60:6AFD7176 |
| html-safe-nonce | 152926f49c257b881a040c96bb7e7dcdd83c8c374aafca4bcd0c41bf2981545f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUIyOkI0MzUxOkQ2QUNBOjEzQkY2MDo2QUZENzE3NiIsInZpc2l0b3JfaWQiOiI0NDgwNjQ3MTA5MTg3MzAxNzUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 91e08c8b0dfe96f4b017d240a452efa7cea4d2e2cda220ee31e0158aa2ef1e8c |
| hovercard-subject-tag | issue:5064880353 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/libgit2/libgit2sharp/2189/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1bfbc33ada923b119ea13ef6250778c5abfd19522741fee43d4ba74a4694a183/libgit2/libgit2sharp/issues/2189 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1bfbc33ada923b119ea13ef6250778c5abfd19522741fee43d4ba74a4694a183/libgit2/libgit2sharp/issues/2189 |
| og:image:alt | 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(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mburtka |
| hostname | github.com |
| expected-hostname | github.com |
| None | e54006cf2b96d1ac260960edd10003132911469ccd1ec99c9803119fe2a4e032 |
| turbo-cache-control | no-preview |
| go-import | github.com/libgit2/libgit2sharp git https://github.com/libgit2/libgit2sharp.git |
| octolytics-dimension-user_id | 394745 |
| octolytics-dimension-user_login | libgit2 |
| octolytics-dimension-repository_id | 1415168 |
| octolytics-dimension-repository_nwo | libgit2/libgit2sharp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1415168 |
| octolytics-dimension-repository_network_root_nwo | libgit2/libgit2sharp |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5be0bf2b8cf26f8897d31e6bc3c232d328b12a54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width