164
164
if len(expected_sha) == 40:
165
165
if expected_sha != object.sha().hexdigest().encode('ascii'):
166
166
raise AssertionError("Invalid sha for %r: %s" % (object,
168
168
elif len(expected_sha) == 20:
169
169
if expected_sha != object.sha().digest():
170
170
raise AssertionError("Invalid sha for %r: %s" % (object,
173
173
raise AssertionError("Unknown length %d for %r" % (len(expected_sha),
177
177
def directory_to_tree(path, children, lookup_ie_sha1, unusual_modes, empty_file_name,