From ecd7197714afbf5b59c274bfe5f0db6eb1c2e8fa Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Tue, 9 Feb 2021 21:02:59 +0000
Subject: [PATCH] Avoid checkout errors by cloning each time

---
 builder/build.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/builder/build.py b/builder/build.py
index cbfbbb4..f8d46bc 100644
--- a/builder/build.py
+++ b/builder/build.py
@@ -4,6 +4,7 @@ building.py - utils for checking out and building
 
 import os
 import subprocess
+import shutil
 
 from termcolor import colored
 
@@ -44,18 +45,16 @@ def checkout(repo, branch):
 
     target_dir = get_dir(repo)
     if not os.path.exists(target_dir):
-        clone(repo)
+        shutil.rmtree(target_dir)
+    clone(repo)
 
     cwd = os.getcwd()
     os.chdir(target_dir)
     print("Path: ", os.getcwd())
     cmds = [
-        ['git', 'pull'],
         ['git', 'checkout', '-B', branch],
         ['git', 'branch', '--set-upstream-to=origin/{}'.format(branch), branch],
         ['git', 'pull'],
-        ['git', 'push', '-u', 'origin', branch],
-        ['git', 'pull'],
     ]
     for cmd in cmds:
         run(cmd)
-- 
GitLab