Why not adopt me?
NAME
Git::Wrapper::Plus::Refs - Work with refs
VERSION
version 0.003000
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 = Git::Wrapper::Plus::Refs->new( git => $git_wrapper );
$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.
METHODS
refs
Lists all refs
in the refs/
namespace
.
for my $ref ( $reffer->refs() ) {
$ref # A Git::Wrapper::Plus::Ref
}
Shorthand for
for my $ref ( $reffer->get_ref('refs/**') ) {
}
get_ref
Fetch a given ref
, or collection of ref
s, 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 ☺.
ATTRIBUTES
git
REQUIRED: A Git::Wrapper compatible object
AUTHOR
Kent Fredric <kentfredric@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 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.