-open(IN, '-|', 'git status') or die $!;
-my $status = join('', <IN>);
-close IN;
-die "The checkout is not clean:\n", $status unless $status =~ /\nnothing to commit \(working directory clean\)/;
-my($cur_branch) = $status =~ /^# On branch (.+)\n/;
-if ($cur_branch ne $master_branch) {
- print "The checkout is not on the $master_branch branch.\n";
- exit 1 if $master_branch ne 'master';
- print "Do you want to release branch $cur_branch? [n] ";
- $_ = <STDIN>;
- exit 1 unless /^y/i;
- $master_branch = $cur_branch;
-}
+require 'packaging/git-status.pl';
+check_git_state($master_branch, 1, 1);