diff mbox series

[meta-arago,oe-layersetup,4/5] oe-layertool-setup: fix bug with branch checkout

Message ID 20260205225528.92769-6-rs@ti.com
State New
Headers show
Series oe-layertool-setup: general clean up and bugfix | expand

Commit Message

Randolph Sapp Feb. 5, 2026, 10:55 p.m. UTC
From: Randolph Sapp <rs@ti.com>

Switch the if/else branches to correctly deal with a local branch that
already matches our expected branch name.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 oe-layertool-setup.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh
index 979390f..db870af 100755
--- a/oe-layertool-setup.sh
+++ b/oe-layertool-setup.sh
@@ -462,9 +462,9 @@  checkout_branch() {
     # else just checkout the existing branch
     if git branch | grep -q "$branch"
     then
-        git checkout "origin/$branch" -b "$branch" --track
-    else
         git checkout "$branch"
+    else
+        git checkout "origin/$branch" -b "$branch" --track
     fi
 
     # Now that we are on the proper branch pull the remote branch changes if