The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::BrewBuild::Git - Git repository manager for the Test::BrewBuild test platform system.

SYNOPSIS

    use Test::BrewBuild::Git;

    my $git = Test::BrewBuild::Git->new;

    my $repo_link = $git->link;

    my $repo_name = $git->name($link);

    $git->clone($repo_link);

    $git->pull;

DESCRIPTION

Manages Git repositories, including gathering names, cloning, pulling etc.

METHODS

new

Returns a new Test::BrewBuild::Git object.

Parameters:

    debug => $level

Optional, Integer. $level vary between 0-7, 0 being the least verbose.

git

Returns the git command for the local platform.

Fetches and returns the full link to the master repository from your current working directory. This is the link you used to originally clone the repo.

name($link)

Extracts the repo name from the full link path.

clone($repo)

Clones the repo into the current working directory.

pull

While in a repository directory, pull down any updates.

revision(remote => $bool, repo => $github_url)

Returns the current commit SHA1 for a repo, with ability to get the local commit or remote commit SHA1 sum.

Parameters:

All parameters are passed in as a hash.

    repo

Optional, string. The Github url to the repo. If not sent in, we will attempt to get this information from the current working directory. Mandatory if the remote parameter is sent in.

    remote

Optional, bool. If sent in, we'll fetch the current commit's SHA1 sum from Github itself, else we'll get the sum from the most recent local, unpushed commit. The repo parameter is mandatory if this one is sent in.

status

Returns true of the repo we're working on is behind or equal to the remote regarding commits, and false if we're ahead.

AUTHOR

Steve Bertrand, <steveb at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2017 Steve Bertrand.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.