chiark / gitweb /
Better error when source package contains .git. Closes: #720555.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 66652983bd5e54e7cff238f6f226d4caf9548801..645528f63c6f7f22dfc59a103fbb0e0452b9dd4d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -488,7 +488,7 @@ sub mktree_in_ud_from_only_subdir () {
     $dirs[0] =~ m#^([^/]+)/\.$# or die;
     my $dir = $1;
     chdir $dir or die "$dir $!";
-    die if stat '.git';
+    fail "source package contains .git directory" if stat '.git';
     die $! unless $!==&ENOENT;
     runcmd qw(git init -q);
     rmtree('.git/objects');
@@ -852,8 +852,9 @@ sub dopush () {
     my $changes = parsecontrol($changesfile,$changesfile);
     foreach my $field (qw(Source Distribution Version)) {
        $changes->{$field} eq $clogp->{$field} or
-           fail "changes field $field \`$changes->{$field}'"
+           fail "changes field $field \`$changes->{$field}'".
                " does not match changelog \`$clogp->{$field}'";
+    }
     my $tag = debiantag($dversion);
     if (!check_for_git()) {
        create_remote_git_repo();
@@ -1063,7 +1064,7 @@ sub build_source {
     check_not_dirty();
     my $clogp = parsechangelog();
     $package = getfield $clogp, 'Source';
-    my $isuite = getfield $clogp, 'Distribution';
+    $isuite = getfield $clogp, 'Distribution';
     $version = getfield $clogp, 'Version';
     $sourcechanges = "${package}_${version}_source.changes";
     $dscfn = dscfn($version);