 update: submodules

This commit is contained in:
piecka 2025-05-13 16:00:23 +02:00
parent 02f36c63b6
commit a2fd078056

2
.zshrc
View file

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