Skip to content

Commit

Permalink
Skip site-wide hooks when running git commit
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
book committed May 11, 2016
1 parent d0487a6 commit 20eeb12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions t/20-simple.t
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion t/30-test_repository.t
Expand Up @@ -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
Expand Down

0 comments on commit 20eeb12

Please sign in to comment.