Open rsabirov opened 6 years ago
This is expected. There is no entry for /
a couple of reasons. One being that the root tree isn't contained in anything. Another is that the paths are relative to the root tree, and /
isn't an allowed path in a Git tree anyway.
You get to the commit's tree via Commit.Tree
.
Thank you for explanation @carlosmn, but it's still little bit strange as it works in file systems.
Don't you think that it would be a little bit strange if /
did work but it was the only /
prefixed path? That would defy my expectations.
You could make an argument that commit[""]
should work, but I don't think commit["/"]
is at all consistent.
Let me clarify, I am not expecting that it will be commit["/"]
. It can be commit[""]
or commit["."]
, it doesn't matter. The problem is that there is no way to get TreeEnty
for root at all.
From my point of view there is no difference between root folder and any other folder.
Thanks for the update. This seems rather reasonable.
I am creating Virtual File system for my application. As input I am getting file paths or directory paths. I found that app works perfectly for any paths except for root.
Technically speaking I cannot get
TreeEntry
for repo root directory.