From e4d8d98ea1cad99f312288198dd0df5f09e07e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 18 Jul 2011 17:53:25 +0200 Subject: git-synk: don't checkout a non already checked out branch --- git-synk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-synk b/git-synk index fe9521b..993cf5a 100755 --- a/git-synk +++ b/git-synk @@ -41,7 +41,7 @@ for gitdir in ${GIT_DIR}; do echo -e " ${RED}${GIT_REMOTE} remote not found ${RESET}" && cd .. && continue fi # CHECKOUT - echo -ne " ${CYAN}checkout $YELLOW$GIT_BRANCH$RESET ... " && git checkout -q ${GIT_BRANCH} 2>/dev/null && echo -e "${GREEN}OK${RESET}" + echo -ne " ${CYAN}checkout $YELLOW$GIT_BRANCH$RESET ... " && git branch | grep -q -e " ${GIT_BRANCH}\$" && git checkout -q ${GIT_BRANCH} 2>/dev/null && echo -e "${GREEN}OK${RESET}" if [ $? -ne 0 ]; then echo -e "${RED}KO${RESET}" && cd .. && continue fi -- cgit v1.1-2-g2b99