我有一个基于德威的工作结帐功能:
def checkout(repo, ref=None):
if ref is None:
ref = repo.head()
index = repo.index_path()
tree_id = repo[ref].tree
build_index_from_tree(repo.path, index, repo.object_store, tree_id)
return [repo.object_store.iter_tree_contents(tree_id)]
但是我将如何修改它以签出单个文件或目录?
有什么东西可以代替这build_index_from_tree
条线吗?