Dist-Zilla-Plugin-Git-Contributors

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.034     2018-04-22 08:59:29Z
          - also handle $zilla->authors possibly returning a list (as in
            Dist::Zilla v7)

0.033     2018-04-22 08:48:13Z
          - 'paths' as reported in config metadata is now once again the exact
            string passed to zilla, rather than normalized paths (fixes issues
            in upcoming Dist::Zilla v7)

0.032     2017-12-06 01:30:30Z
          - fix tests to work on git before 2.0.0, where gpgsign is not
            implemented

0.031     2017-11-29 02:15:17Z
          - avoid triggering GPG hooks during testing (thanks Ioan Rogers!)

0.030     2017-05-12 15:57:35Z
          - remove spaces from config data dumped to META, which parses badly
            on older YAML decoders in the toolchain

0.029     2016-10-14 01:12:15Z

t/lib/GitSetup.pm  view on Meta::CPAN

        }

        ok(!$in_git, 'tempdir is not in a real git repository');
    }

    return $tempdir;
}

# adds --no-verify to all 'git commit' commands, to avoid triggering any
# globally-configured pre-commit hooks, and disable any globally configured
# automatic gpg signing
{
    package My::Git::Wrapper;
    use parent 'Git::Wrapper';

    our $has_gpgsign;

    sub commit {
        my $git = shift;
        return $git->RUN(commit => @_, {
            'no-verify' => 1,
            $has_gpgsign ? ( '-c' => 'commit.gpgsign=false' ) : (),
        });
    }
}

# does some preliminary setup of the test Git::Wrapper object
# and a sanity check
sub git_wrapper
{
    my $root = shift;
    my $config = shift || {};

t/lib/GitSetup.pm  view on Meta::CPAN

    my $version = $git->version;
    my $err = $git->ERR;
    diag explain @$err if @$err;

    diag 'Testing with git version: ' . $version;
    plan skip_all => "Need git v1.5.0 for 'config' subcommand" if versioncmp($version, '1.5.0') < 0;

    plan skip_all => 'Need mysysgit v1.7.10 for proper unicode support on windows (https://github.com/msysgit/msysgit/wiki/Git-for-Windows-Unicode-Support)'
        if $^O eq 'MSWin32' and versioncmp($version, '1.7.10') < 0;

    $My::Git::Wrapper::has_gpgsign = versioncmp($version, '2.0.0') >= 0;

    $git->init({ '-c', 'init.defaultBranch=main' });

    $err = $git->ERR;
    diag explain @$err if @$err;

    # allow overriding configs, or skipping entirely
    if (not exists $config->{setup_user} or $config->{setup_user}) {
        $git->config('user.name', $config->{'user.name'} || 'Test User');
        $git->config('user.email', $config->{'user.email'} || 'test@example.com');



( run in 0.766 second using v1.01-cache-2.11-cpan-e1769b4cff6 )