By psssing --include-removal to dpkg-source, and tolerating it when we
do our quilt fixup analysis.
dpkg-source has supported this since at least stretch.
Closes:#848901.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit (2.13~) unstable; urgency=medium
dgit (2.13~) unstable; urgency=medium
+ * quilt fixup: Permit creation of patches which delete files, by psssing
+ --include-removal to dpkg-source, and tolerating it when we do our
+ quilt fixup analysis. dpkg-source has supported this since at least
+ stretch. Closes:#848901.
local $ENV{'EDITOR'} = cmdoutput qw(realpath --), $0;
local $ENV{'VISUAL'} = $ENV{'EDITOR'};
local $ENV{$fakeeditorenv} = cmdoutput qw(realpath --), $descfn;
local $ENV{'EDITOR'} = cmdoutput qw(realpath --), $0;
local $ENV{'VISUAL'} = $ENV{'EDITOR'};
local $ENV{$fakeeditorenv} = cmdoutput qw(realpath --), $descfn;
- runcmd @dpkgsource, qw(--commit .), $patchname;
+ runcmd @dpkgsource, qw(--commit --include-removal .), $patchname;
- die "deleted\n" unless $newmode =~ m/[^0]/;
- die "not a plain file\n" unless $newmode =~ m/^10\d{4}$/;
- if ($oldmode =~ m/[^0]/) {
+ die "not a plain file\n"
+ unless $newmode =~ m/^10\d{4}$/ ||
+ $oldmode =~ m/^10\d{4}$/;
+ if ($oldmode =~ m/[^0]/ &&
+ $newmode =~ m/[^0]/) {
die "mode changed\n" if $oldmode ne $newmode;
} else {
die "mode changed\n" if $oldmode ne $newmode;
} else {
- die "non-default mode\n" unless $newmode =~ m/^100644$/;
+ die "non-default mode\n"
+ unless $newmode =~ m/^100644$/ ||
+ $oldmode =~ m/^100644$/;
+ git commit -m deleted
+attempt
badly-1 src.c 'mode changed'
chmod +x src.c
badly-1 src.c 'mode changed'
chmod +x src.c