Kent Fredric │‫3﹪🔋

NAME

Dist::Zilla::Util::Git::Refs - Work with refs

VERSION

version 0.002000

SYNOPSIS

After doing lots of work with Git::Wrapper, I found there's quite a few ways to work with refs, and those ways aren't exactly all equal, or supported on all versions of git.

This abstracts it so things can just use them.

    my $refs = Dist::Zilla::Util::Git::Refs->new( zilla => $self->zilla );

    $refs->refs(); # A ::Ref object for each entry from `git ls-remote .`

    my ( @results ) = $refs->get_ref('refs/**'); # the same thing

    my ( @results ) = $refs->get_ref('refs/heads/**'); # all branches

    my ( @results ) = $refs->get_ref('refs/tags/**'); # all tags

    my ( @results ) = $refs->get_ref('refs/remotes/**'); # all remote branches

Note: You probably shouldn't use this module directly, and should instead use one of the ::Util::Git family.

METHODS

refs

Lists all refs in the refs/ namespace.

    my (@refs) = $reffer->refs();

Shorthand for

    my (@refs) = $reffer->get_ref('refs/**');

get_ref

Fetch a given ref, or collection of refs, matching a specification.

    my ($ref) = $reffer->get_ref('refs/heads/master');
    my (@branches) = $reffer->get_ref('refs/heads/**');
    my (@tags)   = $reffer->get_ref('refs/tags/**');

Though reminder, if you're working with branches or tags, use the relevant modules =).

AUTHOR

Kent Fredric <kentfredric@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Kent Fredric <kentfredric@gmail.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.