ShipIt/Step/Commit.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 22 CC 2 SCAR 13.9
CC
2
Cov
0%
run
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package ShipIt::Step::Commit;
2 use strict;
3 use base 'ShipIt::Step';
4  
5 sub run {
6 my ($self, $state) = @_;
7 my $vc = $state->vc;
8 my $ver = $state->version;
9  
10 my $msg = "Checking in changes prior to tagging of version $ver.\n\nChangelog diff is:\n\n";
11  
12 foreach my $f ($state->changelog_files) {
13 $msg .= $vc->local_diff($f);
14 }
15  
16 if ($state->dry_run) {
17 print "DRY-RUN. Would have committed message of:\n----------------\n$msg\n-----------\n";
18 return;
19 }
20  
21 $vc->commit($msg);
22  
23 }
24  
25 1;