diff --git a/.zshrc b/.zshrc index 2fd4404..0248dab 100644 --- a/.zshrc +++ b/.zshrc @@ -369,9 +369,9 @@ __git__() { echo "${CYAN}${BOLD}-- Checking submodule branches... --${NC}" git submodule foreach ' + echo "${RED}Submodule: $name ${NC}" branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "detached") if [ "$branch" = "detached" ]; then - echo "${RED}Submodule: $name ${NC}" default_branch=$(git config -f $toplevel/.gitmodules submodule.$name.branch || echo "main") echo "${RED}${BOLD}Submodule $name is detached. Checking out ${YELLOW} $default_branch${RED}...${NC}" git checkout $default_branch