本文整理匯總了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)))