Rewrite snapshot_get in terms of snapshot_get_branches
Summary:
This increases uniformity and reduces code duplication between the two
functions. The addition of the 'next_branch' return value in
snapshot_get_branches allows callers to get branches incrementally in a loop
which is friendlier.
Depends on D545
Test Plan: tests have been updated to add the new next_branch field
Reviewers: anlambert
Differential Revision: https://forge.softwareheritage.org/D546