summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-09-02 23:17:26 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-09-03 18:12:47 +0100
commit2286b68e5b63348a3e1d18b054152852801a5791 (patch)
tree85f5c6f49ce5ab09113a0bbf7d03bdfeb9651047 /dgit
parent021c3ce3426825731a94ce0312da16c70d84c5df (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-xdgit7
1 files changed, 3 insertions, 4 deletions
diff --git a/dgit b/dgit
index 9079ef3..f95e246 100755
--- a/dgit
+++ b/dgit
@@ -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 ($@) {