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

NAME

Git::Repository::Plugin::TestSetUp - Helper methods for setting up a Git repository

VERSION

version 0.005

SYNOPSIS

    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);

DESCRIPTION

Adds methods to the Git::Repository object that can be used for setting up Git repositories.

METHODS

Git::Repository::Plugin::TestSetUp adds the following methods:

init_tmp_repo(@init_opts)

Initializes a new repository in a temporary directory. Options, such as --bare, can be passed in.

new_tmp_repo(@init_opts, $options)

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.

clone_tmp_repo(@clone_opts, $options)

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_hook($source, $target)

Install a $target, e.g. 'pre-receive', hook into the repository.

SEE ALSO

Git::Repository

AUTHOR

Nathaniel G. Nutter <nnutter@cpan.org>

COPYRIGHT

Copyright 2013 - Nathaniel G. Nutter

LICENSE

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