diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-29 04:51:02 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-29 05:02:21 +0100 |
commit | 3028f34f1868b3726f856ede688437b5279c2b05 (patch) | |
tree | 8d8d5644820159a24753e8891c18259ab0f74bc2 /dgit | |
parent | f7559bb3b9d43f6ac272841f9bcd2620db51b7f2 (diff) |
Remove // from inside conditionals
This idiom is terse, but quite confusing. Instead, handle the undef
case explicitly.
While we are editing these:
* Change two internal errors from die to confess
* Fix a die in git-debrebase which ought to be badusage
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -824,7 +824,8 @@ sub access_forpush () { } sub pushing () { - die "$access_forpush ?" if ($access_forpush // 1) ne 1; + confess 'internal error '.Dumper($access_forpush)," ?" if + defined $access_forpush and !$access_forpush; badcfg "pushing but distro is configured readonly" if access_forpush_config() eq '0'; $access_forpush = 1; @@ -4439,7 +4440,8 @@ END responder_send_command("param isuite $isuite"); responder_send_command("param tagformat $tagformat"); if (defined $maintviewhead) { - die unless ($protovsn//4) >= 4; + confess "internal error (protovsn=$protovsn)" + if defined $protovsn and $protovsn < 4; responder_send_command("param maint-view $maintviewhead"); } @@ -7049,8 +7051,8 @@ sub check_env_sanity () { foreach my $name (qw(PIPE CHLD)) { my $signame = "SIG$name"; my $signum = eval "POSIX::$signame" // die; - ($SIG{$name} // 'DEFAULT') eq 'DEFAULT' or - die "$signame is set to something other than SIG_DFL\n"; + die "$signame is set to something other than SIG_DFL\n" + if defined $SIG{$name} and $SIG{$name} ne 'DEFAULT'; $blocked->ismember($signum) and die "$signame is blocked\n"; } |