chiark / gitweb /
dgit: import-dsc: Parse `Dgit:' field properly, using only \w+
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Jan 2017 17:27:25 +0000 (17:27 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2017 22:14:26 +0000 (22:14 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 555e1c00905f30f0da4c18f54ac40c39b8d59ae8..7c282532b044daaf9afd64337c5fcb0418af2499 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -5889,9 +5889,10 @@ sub cmd_import_dsc {
     parse_dscdata();
 
     my $dgit_commit = $dsc->{$ourdscfield[0]};
     parse_dscdata();
 
     my $dgit_commit = $dsc->{$ourdscfield[0]};
-    if (defined $dgit_commit && 
-       !forceing [qw(import-dsc-with-dgit-field)]) {
+    if (defined $dgit_commit
+       && !forceing [qw(import-dsc-with-dgit-field)]) {
        $dgit_commit =~ m/\w+/ or fail "invalid hash in .dsc";
        $dgit_commit =~ m/\w+/ or fail "invalid hash in .dsc";
+       $dgit_commit = $&;
        progress "dgit: import-dsc of .dsc with Dgit field, using git hash";
        my @cmd = (qw(sh -ec),
                   "echo $dgit_commit | git cat-file --batch-check");
        progress "dgit: import-dsc of .dsc with Dgit field, using git hash";
        my @cmd = (qw(sh -ec),
                   "echo $dgit_commit | git cat-file --batch-check");