Page MenuHomeSoftware Heritage

Do not exclude falsy git objects from being added.
ClosedPublic

Authored by vlorentz on Jul 30 2021, 6:12 PM.

Details

Summary

AFAICT that's only the empty tree, because trees are the only Dulwich object
with a len, and no Dulwich objects have a bool.

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 D6049 (id=21878)

Rebasing onto c67ab0269e...

Current branch diff-target is up to date.
Changes applied before test
commit 92ef526eb663d753405e5bbd20460f7300d67d51
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Jul 30 18:12:03 2021 +0200

    Do not exclude falsy git objects from being added.
    
    AFAICT that's only the empty tree, because trees are the only Dulwich object
    with a __len__, and no Dulwich objects have a __bool__.

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

ardumont added a subscriber: ardumont.

lgtm

One remark inline.

swh/loader/git/from_disk.py
168

Note that this is the from_disk implementation, the one mostly (if not completely) used
in production is the other one.

Check swh.loader.git.tasks.UpdateGitRepository which is using
swh.loader.git.loader.GitLoader.

This revision is now accepted and ready to land.Aug 3 2021, 8:51 AM
swh/loader/git/from_disk.py
168

it inherits the new test

swh/loader/git/from_disk.py
168

true ;)