Git::Repository::Plugin::TestSetUp - Helper methods for setting up a Git repository
version 0.006
use Git::Repository qw(TestSetUp); # easily create a temporary repository to test with my $repo = Git::Repository->new_tmp_repo(); # install a hook into the temporary repository $repo->install_hook('my-hook-file', 'pre-receive'); # clone an existing repo into a temporary directory my $clone_repo = Git::Repository->clone_tmp_repo('--bare', $repo->git_dir);
Adds methods to the Git::Repository object that can be used for setting up Git repositories.
Git::Repository::Plugin::TestSetUp adds the following methods:
Initializes a new repository in a temporary directory. Options, such as --bare, can be passed in.
--bare
Initializes a new repository in a temporary directory and returns a Git::Repository object. Like init_tmp_repo, new_tmp_repo accepts a list of options for the init command and like Git::Repository's new new_tmp_repo also accepts a reference to an option hash.
init_tmp_repo
new_tmp_repo
init
new
Clones a repository into a temporary directory and returns a Git::Repository object. Like init_tmp_repo, new_tmp_repo accepts a list of options for the init command and like Git::Repository's new new_tmp_repo also accepts a reference to an option hash.
Install a $target, e.g. 'pre-receive', hook into the repository.
$target
Git::Repository
Nathaniel G. Nutter <nnutter@cpan.org>
Copyright 2013 - Nathaniel G. Nutter
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Git::Repository::Plugin::Test, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Repository::Plugin::Test
CPAN shell
perl -MCPAN -e shell install Git::Repository::Plugin::Test
For more information on module installation, please visit the detailed CPAN module installation guide.