+ printdone "fetched to ".lrref()." and merged into HEAD";
+}
+
+sub check_not_dirty () {
+ my $output = cmdoutput @git, qw(status --porcelain);
+ if (length $output) {
+ my $m = "tree dirty:\n$output\n";
+ if (!$dryrun) {
+ die $m;
+ } else {
+ warn $m;
+ }
+ }
+}
+
+sub commit_quilty_patch () {
+ my $output = cmdoutput @git, qw(status --porcelain);
+ my $vsn = $dsc->{Version};
+ my %fixups = map {$_=>1}
+ (".pc/debian-changes-$vsn/","debian/patches/debian-changes-2.8-5");
+ my @files;
+ foreach my $l (split /\n/, $output) {
+ next unless $l =~ s/^\?\? //;
+ next unless $fixups{$l};
+ push @files, $l;
+ }
+ print DEBUG "checking for quilty\n", Dumper(\@files);
+ if (@files == 2) {
+ runcmd_ordryrun @git, qw(add), @files;
+ runcmd_ordryrun
+ @git, qw(commit -m), "Commit Debian 3.0 (quilt) metadata";
+ }