libgit2 / pygit2

Python bindings for libgit2

Home Page:https://www.pygit2.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tree __contains__ checks for subdirectories

jleclanche opened this issue · 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", ...)