diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-12-20 21:14:48 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-12-20 21:37:56 +0000 |
commit | 1f7b9876c5641666901f40888eb8a975449569c1 (patch) | |
tree | 706fdf658bdce60e51533a2ce7d004b57a674f9e | |
parent | 185907d9a5936f4cf280372b817e5ecbf7df0a89 (diff) |
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.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | debian/changelog | 5 | ||||
-rwxr-xr-x | dgit | 14 | ||||
-rwxr-xr-x | tests/tests/unrepresentable | 5 |
3 files changed, 16 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog index 9d8b214..64ed65c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ 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. -- @@ -4460,7 +4460,7 @@ END 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; } } @@ -4495,12 +4495,16 @@ sub quiltify_trees_differ ($$;$$$) { if ($unrepres) { eval { - 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 "non-default mode\n" unless $newmode =~ m/^100644$/; + die "non-default mode\n" + unless $newmode =~ m/^100644$/ || + $oldmode =~ m/^100644$/; } }; if ($@) { diff --git a/tests/tests/unrepresentable b/tests/tests/unrepresentable index 88a6972..9dd2111 100755 --- a/tests/tests/unrepresentable +++ b/tests/tests/unrepresentable @@ -30,9 +30,10 @@ badly-1 symlink 'not a plain file' git add symlink badly-2 -badly-1 src.c deleted +start git rm src.c -badly-2 + git commit -m deleted +attempt badly-1 src.c 'mode changed' chmod +x src.c |