chiark / gitweb /
dgit: unrepres. changes: Tolerate deletion of executable files
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Jul 2017 10:28:50 +0000 (11:28 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Jul 2017 11:47:01 +0000 (12:47 +0100)
We don't care what the old mode was; if we tell dpkg-source to record
the deletion it can do so.

But we do care that it was a file.  Experimentally, dpkg-source on
stretch ignores attempts to delete symlinks.

The removal of the check for $newmode has no functional change,
because in this context we know that $newmode is all 0s.  If it
wasn't, we would have been in "both old and new files exist", above.
So that limb of the test will never match and should be removed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit
tests/tests/unrepresentable

index f91290ea44a56a71afaa8ebfd3a0ee0edaf947f2..478ad5feabc7e90a44d751e1627250d3b3dbd898 100644 (file)
@@ -8,6 +8,7 @@ dgit (3.12~) unstable; urgency=medium
   * dgit import: Defend against broken symlinks in ..
   * dgit import: Right error message for missing files in ..
   * dgit import: Avoid making broken symlinks in ..
+  * quilt fixup: Tolerate deletion of executable files.
 
   Important bugfixes to other components:
   * dgit-repos-server: Do not reject commits with no author/committer
diff --git a/dgit b/dgit
index 1f1563075bbc065d80fea603c5e5e2bb05d41631..d1bf2136a6d86550f847e5d071322a3227885864 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4920,9 +4920,8 @@ sub quiltify_trees_differ ($$;$$$) {
                    die "modified symlink\n" unless $newmode =~ m/^10/;
                } elsif ($oldmode =~ m/[^0]/) {
                    # deletion
-                   die "non-default mode or type\n"
-                       unless $newmode =~ m/^100644$/ ||
-                              $oldmode =~ m/^100644$/;
+                   die "deletion of symlink\n"
+                       unless $oldmode =~ m/^10/;
                } else {
                    # creation
                    die "non-default mode or type\n"
index 206af866b5c6eb7a63bd93318c756e8058cbde51..80b5a055d5ac1c7033050e14011a3924b3061ec1 100755 (executable)
@@ -30,7 +30,7 @@ badly-1 orig-symlink 'modified symlink'
        git add orig-symlink
 badly-2
 
-badly-1 orig-symlink 'non-default mode or type'
+badly-1 orig-symlink 'deletion of symlink'
        git rm -f orig-symlink
 badly-2