From fe216b34e36c059be82c18cfe850c729e5c8df21 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 6 Jun 2019 16:33:10 +0100 Subject: [PATCH] dgit: split brain reorg: Slight internal error check improvements Move the $made_split_brain and $do_split_brain checks outside various conditionals. And change a die to a confess. Signed-off-by: Ian Jackson --- dgit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dgit b/dgit index 7808fd82..92078745 100755 --- a/dgit +++ b/dgit @@ -4565,6 +4565,8 @@ END } } + confess unless !!$made_split_brain == !!$do_split_brain; + changedir $playground; progress f_ "checking that %s corresponds to HEAD", $dscfn; runcmd qw(dpkg-source -x --), @@ -4578,7 +4580,6 @@ END my $r = system @diffcmd; if ($r) { if ($r==256) { - confess unless !!$made_split_brain == !!$do_split_brain; my $referent = $made_split_brain ? $dgithead : 'HEAD'; my $diffs = cmdoutput @git, qw(diff --stat), $tree, $dgithead; @@ -5837,7 +5838,7 @@ sub build_maybe_quilt_fixup () { # remain dgit-view, rather than master, so subsequent calls to # unpack_playtree_need_cd_work # will DTRT, resetting dgit-view. - die if $made_split_brain; + confess if $made_split_brain; $made_split_brain = 1; } chdir '..'; @@ -6771,6 +6772,8 @@ sub build_source { unlink "$buildproductsdir/$sourcechanges" or $!==ENOENT or fail f_ "remove %s: %s", $sourcechanges, $!; } + confess unless !!$made_split_brain == !!$do_split_brain; + my @cmd = (@dpkgsource, qw(-b --)); my $leafdir; if (building_source_in_playtree()) { @@ -6779,7 +6782,6 @@ sub build_source { # If we are in split brain, there is already a playtree with # the thing we should package into a .dsc (thanks to quilt # fixup). If not, make a playtree - confess unless !!$made_split_brain == !!$do_split_brain; prep_ud() unless $made_split_brain; changedir $playground; unless ($made_split_brain) { -- 2.30.2