很难弄清楚如何更新一个多层次的条目。下面的示例试图更新test/hist/out处的文件,但它也会从test/hist/中删除所有其他文件。你知道吗
TreeBuilder
构造函数不接受treeentry,只接受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()
解决方法是在TreeBuilders的构造中传递tree['path/to/your/subfolder'].oid。耶!你知道吗
相关问题 更多 >
编程相关推荐