chiark / gitweb /
-p option: Check against changelog
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 22:04:27 +0000 (22:04 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 22:46:35 +0000 (22:46 +0000)
If -p is specified during push, we check that it's right.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index aab59b31e4a2877ef18460918a954b97c3e19354..8264f3e576a625e37cecb9c30bfe70f3596fd9a4 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3200,7 +3200,10 @@ sub push_parse_changelog ($) {
     my $clogp = Dpkg::Control::Hash->new();
     $clogp->load($clogpfn) or die;
 
-    $package = getfield $clogp, 'Source';
+    my $clogpackage = getfield $clogp, 'Source';
+    $package //= $clogpackage;
+    fail "-p specified $package but changelog specified $clogpackage"
+       unless $package eq $clogpackage;
     my $cversion = getfield $clogp, 'Version';
     my $tag = debiantag($cversion, access_basedistro);
     runcmd @git, qw(check-ref-format), $tag;