Changeset View
Changeset View
Standalone View
Standalone View
swh/model/hashutil.py
Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | def hash_git_data(data, git_type, base_algo="sha1"): | ||||
git_object_types = { | git_object_types = { | ||||
"blob", | "blob", | ||||
"tree", | "tree", | ||||
"commit", | "commit", | ||||
"tag", | "tag", | ||||
"snapshot", | "snapshot", | ||||
"raw_extrinsic_metadata", | "raw_extrinsic_metadata", | ||||
"extid", | |||||
} | } | ||||
if git_type not in git_object_types: | if git_type not in git_object_types: | ||||
raise ValueError( | raise ValueError( | ||||
"Unexpected git object type %s, expected one of %s" | "Unexpected git object type %s, expected one of %s" | ||||
% (git_type, ", ".join(sorted(git_object_types))) | % (git_type, ", ".join(sorted(git_object_types))) | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |