Page MenuHomeSoftware Heritage

Rework the way we process snapshots and branches
ClosedPublic

Authored by olasd on Sep 18 2018, 7:02 PM.

Details

Summary

The previous code uses a brittle double-iteration and would break in a subtle
way when having several branches pointing at the same target. Surprisingly, we
didn't notice it before, even though most snapshots have a HEAD and
refs/heads/master branch pointing to the same object.

I've also added FIXMEs for things I noticed should be changed in the long run.

Depends on D415

Test Plan

the test case has been updated to exert the issue in the old code

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert added a subscriber: anlambert.

Thanks for the fixes even if I still did not understand where the issue was (for instance, on https://archive.softwareheritage.org/browse/origin/https://github.com/git/git/branches/, HEAD and refs/head/master point to the same revision and the display is correct). Anyway, the code is much better now, so let's land it!

This revision is now accepted and ready to land.Sep 19 2018, 11:23 AM
This revision was automatically updated to reflect the committed changes.