diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-09-02 23:17:26 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-09-03 18:12:47 +0100 |
commit | 2286b68e5b63348a3e1d18b054152852801a5791 (patch) | |
tree | 85f5c6f49ce5ab09113a0bbf7d03bdfeb9651047 /dgit | |
parent | 021c3ce3426825731a94ce0312da16c70d84c5df (diff) |
dgit: unrepresentable check: Don't tolerate symlink creation
git diff can represent changes to symlinks, but dpkg-source uses
diff(1) to apply changes, and git diff cannot. The result if we
permit them is that we end up making source packages that can't be
built, or aren't treesame to our HEAD.
Reject this early. This resolves the error handling regression in
dgit: quilt fixup: Don't use dpkg-source --commit, but git diff
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -5447,7 +5447,7 @@ sub quiltify_trees_differ ($$;$$$) { if ($unrepres) { eval { - die __ "not a plain file or symlink\n" + die __ "not a plain file\n" unless $newmode =~ m/^(?:10|12)\d{4}$/ || $oldmode =~ m/^(?:10|12)\d{4}$/; if ($oldmode =~ m/[^0]/ && @@ -5463,10 +5463,9 @@ sub quiltify_trees_differ ($$;$$$) { unless $oldmode =~ m/^10/; } else { # creation - die __ "creation with non-default mode\n" + die __ "creation with non-default mode, or symlink\n" unless $newmode =~ m/^100644$/ or - $newmode =~ m/^100755$/ or - $newmode =~ m/^120000$/; + $newmode =~ m/^100755$/; } }; if ($@) { |