无法弄清楚如何更新多层次深度的条目。我下面的示例是尝试更新 test/hist/out 中的文件,但它也会从 test/hist/ 中删除所有其他文件。
构造TreeBuilder
函数不接受 TreeEntries,只接受 Trees,所以我不知道该怎么做。任何想法?
_o = repo.TreeBuilder()
_o.insert('out', blob_id, pygit2.GIT_FILEMODE_BLOB)
_o = _o.write()
_h = repo.TreeBuilder()
_h.insert('hist', _o, pygit2.GIT_FILEMODE_TREE)
_h = _h.write()
_t = repo.TreeBuilder(tree)
_t.insert('test', _h, pygit2.GIT_FILEMODE_TREE)
_t = _t.write()