From patchwork Tue Jun 25 03:26:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Sangorrin X-Patchwork-Id: 11014575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7449B13AF for ; Tue, 25 Jun 2019 03:27:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60B0828B75 for ; Tue, 25 Jun 2019 03:27:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51D8928B91; Tue, 25 Jun 2019 03:27:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D6DBB28B70 for ; Tue, 25 Jun 2019 03:27:00 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CD116AF0; Tue, 25 Jun 2019 03:26:57 +0000 (UTC) X-Original-To: cip-dev@lists.cip-project.org Delivered-To: cip-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 82702AB5 for ; Tue, 25 Jun 2019 03:26:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mo-csw.securemx.jp (mo-csw1515.securemx.jp [210.130.202.154]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1244E7FD for ; Tue, 25 Jun 2019 03:26:55 +0000 (UTC) Received: by mo-csw.securemx.jp (mx-mo-csw1515) id x5P3QfhX010456; Tue, 25 Jun 2019 12:26:41 +0900 X-Iguazu-Qid: 34tMRO62Mdvy29wRZU X-Iguazu-QSIG: v=2; s=0; t=1561433201; q=34tMRO62Mdvy29wRZU; m=xOYW5xLWTSniCCu2SEJ509LQWPB9fl7LonFenda4TqI= Received: from imx12.toshiba.co.jp (imx12.toshiba.co.jp [61.202.160.132]) by relay.securemx.jp (mx-mr1512) id x5P3Qe8d000444; Tue, 25 Jun 2019 12:26:41 +0900 Received: from enc02.toshiba.co.jp ([61.202.160.51]) by imx12.toshiba.co.jp with ESMTP id x5P3Qet8029377; Tue, 25 Jun 2019 12:26:40 +0900 (JST) Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id x5P3QeuB002831; Tue, 25 Jun 2019 12:26:40 +0900 From: Daniel Sangorrin To: ben.hutchings@codethink.co.uk Date: Tue, 25 Jun 2019 12:26:34 +0900 X-TSB-HOP: ON Message-Id: <20190625032636.10694-5-daniel.sangorrin@toshiba.co.jp> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190625032636.10694-1-daniel.sangorrin@toshiba.co.jp> References: <20190625032636.10694-1-daniel.sangorrin@toshiba.co.jp> Cc: cip-dev@lists.cip-project.org Subject: [cip-dev] [cip-kernel-sec 4/6] report_affected: check user supplied branch names X-BeenThere: cip-dev@lists.cip-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cip-dev-bounces@lists.cip-project.org Errors-To: cip-dev-bounces@lists.cip-project.org X-Virus-Scanned: ClamAV using ClamSMTP This makes sure that we return when the user supplied branch names are not within the configured branches. Signed-off-by: Daniel Sangorrin --- scripts/report_affected.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/report_affected.py b/scripts/report_affected.py index bd22e29..7557dc8 100755 --- a/scripts/report_affected.py +++ b/scripts/report_affected.py @@ -27,6 +27,9 @@ def main(git_repo, remotes, name = 'linux-%s.y' % name if branch['short_name'] == name: branches.append(branch) + if not branches: + msg = "supplied branches didn't match any known branch" + raise argparse.ArgumentError(None, msg) else: branches = live_branches if only_fixed_upstream: