chiark / gitweb /
dgit: unrepres. changes: Tolerate creation of symlinks
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Jul 2017 10:41:14 +0000 (11:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Jul 2017 11:47:31 +0000 (12:47 +0100)
Experimentally, dpkg-source on stretch will create patches to create
new symlinks.  (It will fail on attempts to modify existing symlinks
and it ignores attempts to change plain file executability.)

Implementation: add an alternative which tolerates the git symlink
mode.  This replaces the check on $oldmode, which in this context we
know is all 0s and can therefore never match.

While we're here, change the error message.

Closes:#857382.

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

index 478ad5feabc7e90a44d751e1627250d3b3dbd898..aaaee20fd82c27f3003e8813d1327574ac6fa4ab 100644 (file)
@@ -9,6 +9,7 @@ dgit (3.12~) unstable; urgency=medium
   * dgit import: Right error message for missing files in ..
   * dgit import: Avoid making broken symlinks in ..
   * quilt fixup: Tolerate deletion of executable files.
+  * quilt fixup: Tolerate symlink creation (make patches).  Closes:#857382.
 
   Important bugfixes to other components:
   * dgit-repos-server: Do not reject commits with no author/committer
diff --git a/dgit b/dgit
index d1bf2136a6d86550f847e5d071322a3227885864..42647ce02e79d277ef9a211e00eed5986387ffc3 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4924,9 +4924,9 @@ sub quiltify_trees_differ ($$;$$$) {
                        unless $oldmode =~ m/^10/;
                } else {
                    # creation
-                   die "non-default mode or type\n"
-                       unless $newmode =~ m/^100644$/ ||
-                              $oldmode =~ m/^100644$/;
+                   die "creation with non-default mode\n"
+                       unless $newmode =~ m/^100644$/ or
+                              $newmode =~ m/^120000$/;
                }
            };
            if ($@) {
index 80b5a055d5ac1c7033050e14011a3924b3061ec1..89df7199ff6af582f03b8b6d197ef5edd4554db4 100755 (executable)
@@ -44,7 +44,7 @@ badly-1 src.c 'mode or type changed'
        git add src.c
 badly-2
 
-badly-1 new 'non-default mode'
+badly-1 new 'creation with non-default mode'
        echo hi >new
        chmod 755 new
        git add new