App-KGB
view release on metacpan or search on metacpan
t/52-client-git.t view on Meta::CPAN
$commit = $c->describe_commit;
is( $commit, undef );
# now the same on the master branch
$ign = $git->command( [ 'checkout', '-q', 'master' ], { STDERR => 0 } );
( my $gitversion = Git::command_oneline('version') ) =~ s/^git version\s*//;
my ( $major, $minor, $patch, $ignored ) = split( /\./, $gitversion );
note "Git version $major $minor";
if ( $major > 2 or $major == 2 and $minor >= 9 ) { # 2.9.0+
$ign = $git->command( 'merge', 'allnew', '--allow-unrelated-histories' );
} else {
$ign = $git->command( 'merge', 'allnew' );
}
my $mergemsg = $git->command_oneline('log', '-1', '--format=format:%s');
push_ok();
$c2 = $commit = $c->describe_commit;
ok( defined($commit), 'empty branch merge commit exists' );
is( $commit->branch, 'master' );
is( $commit->log, $mergemsg );
TestBot->expect( 'dummy/#test 12test/03there 05master '
. $c2->id
. ' 06Test U. Ser (06ser) ' . $mergemsg . ' * 14http://scm.host.org/there/master/?commit='
. $c2->id
. '' );
$ign = $git->command( checkout => '-q', 'other' );
mkdir( File::Spec->catdir( $local, 'debian', 'patches' ) );
w( File::Spec->catfile( 'debian', 'patches', 'series' ), 'some.patch' );
w( File::Spec->catfile( 'debian', 'patches', 'some.patch' ), 'This is a patch' );
$ign = $git->command( add => 'debian' );
$ign = $git->command( commit => -m => 'A change in two files' );
push_ok();
$commit = $c->describe_commit;
TestBot->expect( 'dummy/#test 12test/03there 05other '
. $commit->id
. ' 06Test U. Ser (06ser) 10debian/patches/ 03series 03some.patch A change in two files * 14http://scm.host.org/there/other/?commit='
. $commit->id
. '' );
##### No more commits after the last
$commit = $c->describe_commit;
is( $commit, undef );
$commit = $c->describe_commit;
is( $commit, undef );
diag `cat $hook_log` if $hook_log and -s $hook_log;
my $output = $test_bot->get_output;
undef($test_bot); # make sure all output us there
eq_or_diff( [split(/\n/, $output)], [split(/\n/, TestBot->expected_output)] );
$c->_reset;
write_tmp("reflog", '');
throws_ok { $c->describe_commit } qr/Reflog was empty/, 'should die without reflog data';
done_testing();
( run in 0.528 second using v1.01-cache-2.11-cpan-ceb78f64989 )