NAME

Dist::Conformance::Snapshot::Tree - A snapshot from a tree listing and a callback that fetches one file

VERSION

version 0.002

SYNOPSIS

use 5.040;
use Dist::Conformance::Snapshot::Tree;

my %blobs    = ( 'CLAUDE.md' => "Load perl-slop:reading-perl first.\n" );
my $snapshot = Dist::Conformance::Snapshot::Tree->new(
    paths => { map { $_ => Dist::Conformance::Snapshot::blob_sha( $blobs{$_} ) } keys %blobs },
    fetch => sub ($path) { $blobs{$path} },
);

DESCRIPTION

A snapshot of a repository that is not on this machine. The caller gives the listing of a git tree and a sub that fetches the content of one path, for example from the recursive tree and the contents endpoints of a forge's API. The checks then fetch only the files that they read.

This snapshot is not writable, so an update cannot run on it.

ATTRIBUTES

paths

Required. A hash reference from each path to its git blob SHA. A recursive git tree gives these as the path and the sha of each blob entry.

fetch

Required. A code reference that takes a path and returns its bytes. It is called at most once per path, and only for a path in "paths".

METHODS

new

Dies unless "paths" is a hash and "fetch" is code.

content

($path). The bytes from "fetch", memoized for the life of the object; undef for a path that the tree does not list.

SEE ALSO

Please see those modules/websites for more information related to this module.

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/Troglodyne-Internet-Widgets/Dist-Conformance/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHORS

Current Maintainers:

  • George S. Baugh <george@troglodyne.net>

COPYRIGHT AND LICENSE

Copyright (c) 2026 Troglodyne LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.