Skip to content

Tree __contains__ checks for subdirectories #306

@jleclanche

Description

@jleclanche

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", ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions