本文整理汇总了Python中objects.Object.new_from_sha方法的典型用法代码示例。如果您正苦于以下问题:Python Object.new_from_sha方法的具体用法?Python Object.new_from_sha怎么用?Python Object.new_from_sha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类objects.Object
的用法示例。
在下文中一共展示了Object.new_from_sha方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_object
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import new_from_sha [as 别名]
def _get_object(self):
"""
:return:
The object our ref currently refers to. Refs can be cached, they will
always point to the actual object as it gets re-created on each query"""
# have to be dynamic here as we may be a tag which can point to anything
# Our path will be resolved to the hexsha which will be used accordingly
return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))