libgit2/pygit2

Tree __contains__ checks for subdirectories

jleclanche opened this issue · 0 comments

This is a really annoying inconsistency:

>>> "foo/boo" in tree
False
>>> tree["foo/boo"]
<_pygit2.TreeEntry object at 0x7f9c44a57318>

I can see why it happens but it's incredibly unnatural.

Similarly, it would be nice if we didn't have to create TreeBuilders for each subdirectory when creating blobs in a subdirectory. eg. be able to do something like treebuilder.insert("foo/bar", ...)