From 2d8ed57a73f0b8cc4ca31e60f85b24d4f6437075 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 15 Dec 2016 00:52:34 +0000 Subject: [PATCH] dgit: Break out access_cfg_tagformats_can_splitbrain While we're at it, use a hash %y rather than repeatedly grepping. No overall functional change. Signed-off-by: Ian Jackson --- dgit | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dgit b/dgit index c280016a..1a23d1a7 100755 --- a/dgit +++ b/dgit @@ -1519,6 +1519,15 @@ sub access_cfg_tagformats () { split /\,/, access_cfg('dgit-tag-format'); } +sub access_cfg_tagformats_can_splitbrain () { + my %y = map { $_ => 1 } access_cfg_tagformats; + foreach my $needtf (qw(new maint)) { + next if $y{$needtf}; + return 0; + } + return 1; +} + sub need_tagformat ($$) { my ($fmt, $why) = @_; fail "need to use tag format $fmt ($why) but also need". @@ -4912,13 +4921,10 @@ sub build_maybe_quilt_fixup () { check_for_vendor_patches(); if (quiltmode_splitbrain) { - foreach my $needtf (qw(new maint)) { - next if grep { $_ eq $needtf } access_cfg_tagformats; - fail <