From 11b092beb00a52031657712f00d70434bd6faec8 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 17 Sep 2022 10:12:09 +0200 Subject: [PATCH] Use git branch -D for reference_branch This commit allows the use of a reference_branch that is not merged into the current working directory. Imports have been sorted by isort --- update-zones.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/update-zones.py b/update-zones.py index f48ad85..23481cb 100755 --- a/update-zones.py +++ b/update-zones.py @@ -5,9 +5,9 @@ import argparse import os import tempfile -from subprocess import CalledProcessError, run -from sys import stderr from email.message import EmailMessage, MIMEPart +from subprocess import DEVNULL, CalledProcessError, run +from sys import stderr REFERENCE_BRANCH = "provisioned" DEFAULT_BRANCH = "origin/main" @@ -246,7 +246,12 @@ def main(reference_branch, target_branch, audit_email_address, audit_sender_addr changelog = get_changelog(reference_branch, target_branch) - run(["git", "branch", "-d", reference_branch], check=True) + run( + ["git", "branch", "-D", reference_branch], + check=True, + stdout=DEVNULL, + stderr=DEVNULL, + ) run(["git", "branch", reference_branch, target_branch], check=True) send_audit_mail(diffs, audit_email_address, audit_sender_address, changelog)