Page MenuHomeSoftware Heritage

Don't assume all GitClient instances have a 'dumb' attribute
ClosedPublic

Authored by vlorentz on May 16 2022, 2:44 PM.

Details

Summary

Only instances of (subclasses of) AbstractHttpGitClient have this attribute.

For other instances, we can consider it to be False, because the dumb
protocol only exists over HTTP(S).

This issue was found by mypy, thanks to the addition of type annotations
to changes in dulwich 0.20.36 affecting mypy's type inference.

Diff Detail

Repository
rDLDG Git loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7835 (id=28300)

Rebasing onto 9b47b24b98...

Current branch diff-target is up to date.
Changes applied before test
commit af41ebde0942257bf11b864856da03e2c252c8e9
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon May 16 14:41:53 2022 +0200

    Don't assume all GitClient instances have a 'dumb' attribute
    
    Only instances of (subclasses of) AbstractHttpGitClient have this attribute.
    
    For other instances, we can consider it to be False, because the dumb
    protocol only exists over HTTP(S).
    
    This issue was found by mypy, thanks to the addition of type annotations
    to changes in dulwich 0.20.36 affecting mypy's type inference.

See https://jenkins.softwareheritage.org/job/DLDG/job/tests-on-diff/213/ for more details.

This revision is now accepted and ready to land.May 16 2022, 3:04 PM