Dulwich.io dulwich / 8b17018
check for valid hexsha Tiago Teixeira a month ago
1 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
6363 )
6464 from dulwich.objects import (
6565 check_hexsha,
66 valid_hexsha,
6667 Blob,
6768 Commit,
6869 ShaFile,
725726 Args:
726727 name: Git object SHA1 or ref name
727728 """
728 if len(name) in (20, 40):
729 if len(name) == 20 or (len(name) == 40 and valid_hexsha(name)):
729730 return name in self.object_store or name in self.refs
730731 else:
731732 return name in self.refs