From 8b5b250bdf1117ce4a5dbe6a872d8f9d587a55b2 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Sat, 23 Aug 2008 22:46:05 -0500 Subject: [PATCH] Fetch before looking for remote branches. --- scripts/gc-checkout | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/gc-checkout b/scripts/gc-checkout index 3a112c5..cdc5ab9 100644 --- a/scripts/gc-checkout +++ b/scripts/gc-checkout @@ -8,10 +8,10 @@ if [[ $? -eq 0 ]] ; then # Just checkout what they asked git checkout "$branch_name" else + # Make sure we have the latest origin/$branch_name to branch + git fetch exists_remote=$(git branch | grep -x " origin/$branch_name" | wc -l) if [[ $exists_remote -eq 0 ]] ; then - # Make sure we have the latest origin/stable to branch - git fetch # Specifying stable to get the last released code git checkout -b "$branch_name" origin/stable # Go ahead and put the branch out on the server @@ -19,8 +19,6 @@ else # Setup the merge property so that pulls come from the right place (instead of stable) git config --replace-all "branch.$branch_name.merge" "refs/heads/$branch_name" else - # Make sure we have the latest origin/$branch_name to branch - git fetch # Do the checkout git checkout -b "$branch_name" "origin/$branch_name" fi -- 2.20.1