From 20eeb1212cbaf04d60785d1adaab2621b464a80d Mon Sep 17 00:00:00 2001 From: "Philippe Bruhat (BooK)" Date: Tue, 10 May 2016 22:35:54 +0200 Subject: [PATCH] Skip site-wide hooks when running `git commit` `git commit --no-verify` exists since at least GIT 0.99.9m aka 1.0rc5 Issue reported in: - http://www.cpantesters.org/cpan/report/09d57d08-ea29-11e5-9af5-f295bf69c04f --- t/20-simple.t | 4 ++-- t/30-test_repository.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/20-simple.t b/t/20-simple.t index 747767c..911fc14 100644 --- a/t/20-simple.t +++ b/t/20-simple.t @@ -98,12 +98,12 @@ SKIP: { skip "this test does not work with msysgit on Win32", 4 if $^O eq 'MSWin32'; - ok( my $cmd = $r->command('commit'), 'git commit' ); + ok( my $cmd = $r->command('commit', '--no-verify'), 'git commit' ); isa_ok( $cmd, 'Git::Repository::Command' ); local $/ = "\n"; my $error = $cmd->stderr->getline; my $git = Git::Repository::Command::_is_git('git'); - is_deeply( [ $cmd->cmdline ], [ $git, 'commit' ], 'command-line' ); + is_deeply( [ $cmd->cmdline ], [ $git, 'commit', '--no-verify' ], 'command-line' ); $cmd->close; like( $error, diff --git a/t/30-test_repository.t b/t/30-test_repository.t index c6f8298..5525333 100644 --- a/t/30-test_repository.t +++ b/t/30-test_repository.t @@ -33,7 +33,7 @@ my $file = 'hello.txt'; print $fh "Hello, world!\n"; } $r->run( add => $file ); -$r->run( commit => '-m' => 'hello' ); +$r->run( qw( commit --no-verify -m hello ) ); my $sha1 = $r->run( 'rev-parse' => 'master' ); # expect test_repository to fail