diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-07-18 17:53:25 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-07-18 17:53:25 +0200 |
commit | e4d8d98ea1cad99f312288198dd0df5f09e07e7d (patch) | |
tree | c6aaf855b441ccb14d7519f45d992c1a5c43ad5c /git-synk | |
parent | aa3b765c15aec711d032472ffd57f712bee19480 (diff) | |
download | bin-e4d8d98ea1cad99f312288198dd0df5f09e07e7d.zip bin-e4d8d98ea1cad99f312288198dd0df5f09e07e7d.tar.gz |
git-synk: don't checkout a non already checked out branch
Diffstat (limited to 'git-synk')
-rwxr-xr-x | git-synk | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |