From fae74aae262992fcf823fb71450d1e1468c343c6 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Sun, 15 Sep 2019 13:37:38 -0600
Subject: [PATCH] Make sure git is on the right branch when running fetch

---
 cook.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cook.sh b/cook.sh
index 5f8396fee..55e6cafb8 100755
--- a/cook.sh
+++ b/cook.sh
@@ -119,6 +119,10 @@ function op {
                         git remote add upstream "$GIT_UPSTREAM"
                         git fetch upstream
                     fi
+                    if [ -n "$BRANCH" ]
+                    then
+                        git checkout "$BRANCH"
+                    fi
                     git pull
                     git submodule sync --recursive
                     git submodule update --init --recursive
-- 
GitLab