Page MenuHomeSoftware Heritage

GitLoader: instantiate SnapshotBranch object using the from_dict factory
AbandonedPublic

Authored by douardda on Mar 27 2020, 4:36 PM.

Details

Reviewers
vlorentz
Group Reviewers
Reviewers
Summary

rather than direct instantiation to ensure proper type conversion of the
target_type argument.

Depends on D2917.

Diff Detail

Repository
rDLDG Git loader
Branch
master
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 11431
Build 17317: tox-on-jenkinsJenkins
Build 17316: arc lint + arc unit

Event Timeline

vlorentz added a subscriber: vlorentz.

DULWICH_TARGET_TYPES are already the right enum values.

This revision now requires changes to proceed.Mar 27 2020, 5:01 PM

DULWICH_TARGET_TYPES are already the right enum values.

Dunno, but without this and running against next swh.model version (with runtime type validation) I have a

AttributeTypeError: target_type must be <enum 'TargetType'> (got revision that is a <class 'str'>)

What about this instead?

self.local_refs: Dict[bytes, Dict[str, Any]] = fetch_info['local_refs']

or just # type: ignore on this line until I fix self.local_refs