From: Karen Etheridge Date: Wed, 21 Aug 2013 15:40:50 +0000 (-0700) Subject: really fix Changes line this time (thanks ribasushi!) X-Git-Tag: v0.002000~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e2d04df8869302061b1ee70cdfc6735877222436;p=p5sagit%2FDistar.git really fix Changes line this time (thanks ribasushi!) --- diff --git a/lib/Distar.pm b/lib/Distar.pm index 8c36df6..11ae8b8 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -92,11 +92,12 @@ sub run_preflight { my $ymd = sprintf( "%i-%02i-%02i", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3] ); + my $changes_line = "$version $ymd\n"; my @cached = grep /^\+/, `git diff --cached -U0`; - @cached > 0 or die "Please add:\n\n$version $ymd\n\nto Changes stage Changes (git add Changes)"; + @cached > 0 or die "Please add:\n\n$changes_line\nto Changes stage Changes (git add Changes)"; @cached == 2 or die "Pre-commit Changes not just Changes line"; $cached[0] =~ /^\+\+\+ .\/Changes\n/ or die "Changes not changed"; - $cached[1] eq "+$version - $ymd\n" or die "Changes new line should be: \n\n$version - $ymd\n "; + $cached[1] eq "+$changes_line" or die "Changes new line should be: \n\n$changes_line "; } {