From c20a40ce6643eddce607a69f3560401f5f28e1e3 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Wed, 13 Jul 2022 18:44:22 -0400
Subject: [PATCH] chill out, state monster

---
 ci-tools/update-nixpkgs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ci-tools/update-nixpkgs b/ci-tools/update-nixpkgs
index ee452e30..bc8b1749 100755
--- a/ci-tools/update-nixpkgs
+++ b/ci-tools/update-nixpkgs
@@ -38,7 +38,8 @@ TARGET_BRANCH="nixpkgs-upgrade-$(date +%Y-%m-%d)"
 echo '{}' > morph/grid/local/public-keys/users.nix
 # nix-build -A morph -o result-before
 
-git checkout "${TARGET_BRANCH}" || git checkout -b "${TARGET_BRANCH}"
+git branch -d "${TARGET_BRANCH}" || true
+git checkout -b "${TARGET_BRANCH}"
 
 # Spawn *another* nix-shell that has the *other* update-nixpkgs tool.  Should
 # sort out this mess sooner rather than later...
-- 
GitLab