Open
Description
The fe5289e introduced the Tree.__contains__
behaviour change, which is inconsistent with Tree.__getitem__
behaviour. I couldn't find a proper explanation for a such change, so it looks like a bug for me:
ipdb> p tree.path
'data_dir'
ipdb> p [i.name for i in tree]
['data_sub_dir']
ipdb> p tree['data_sub_dir']
<git.Tree "43420912747f332d8bbd0859003a032a301ebbd6">
ipdb> p 'data_sub_dir' in tree
False
ipdb> p 'data_dir/data_sub_dir' in tree
True
Not sure if this could be fixed now due to compatibility reasons, but if so, could there be a better workaround than iterating over Tree._cache
?