Package: dpkg-source-gitarchive
Version: 0.2.1
Severity: normal

dpkg-source-gitarchive does not properly handle ~ (or presumably other
characters that are valid in version strings but not in git tags).

https://salsa.debian.org/noahm/waagent/-/jobs/6417314#L139 shows an example of
a failure to construct a source package from git.

It may be sufficient to remap ~ or other illegal characters to _, as `gbp`
does.  A minimal change could look like the following:

diff --git a/lib/Dpkg/Source/Package/V3/Gitarchive/Git.pm 
b/lib/Dpkg/Source/Package/V3/Gitarchive/Git.pm
index 87e0302..98d30a5 100644
--- a/lib/Dpkg/Source/Package/V3/Gitarchive/Git.pm
+++ b/lib/Dpkg/Source/Package/V3/Gitarchive/Git.pm
@@ -68,6 +68,7 @@ sub make_blob {
 sub make_blob_diff {
     my ($self, $upstream_ref, $name) = @_;
     my $diff;
+    $upstream_ref =~ s/~/_/g;
     my @exec = (
         'git', 'diff-tree',
         '--diff-algorithm=myers',

Reply via email to