summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-26 13:27:32 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-26 15:52:45 +0000
commitab9ebfa7172a2d1dcd324a777e74ae45b92f6d1c (patch)
treea1f04a371283bbbd6d68c1426f4e83804d0feb4a /dgit
parent5eefe642ec12e897481d5a86e74d71e11cdf1601 (diff)
include-binaries handling: Tiny refactoring
Hoist the !@bpath check so we can add another statement here with different behaviour. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit6
1 files changed, 4 insertions, 2 deletions
diff --git a/dgit b/dgit
index c8c0fc4..188c20c 100755
--- a/dgit
+++ b/dgit
@@ -6245,8 +6245,10 @@ END
};
$wrong->(f_ "forbidden path component '%s'", $ent)
if grep { $_ eq $ent } '', '.', '..';
- $wrong->(f_ "path starts with '%s'", $ent)
- if !@bpath && grep { $_ eq $ent } qw(debian .git);
+ if (!@bpath) { # check first component
+ $wrong->(f_ "path starts with '%s'", $ent)
+ if grep { $_ eq $ent } qw(debian .git);
+ }
push @bpath, $ent;
$bpath_chk = join '/', @bpath;
if (!lstat "$maindir/$bpath_chk") {