chore: sync bdt.sh v2.7.0 (monorepo @ e06c6bb)
This commit is contained in:
26
bdt.sh
26
bdt.sh
@@ -2232,9 +2232,29 @@ cmd_self_update() {
|
||||
(
|
||||
cd "$cli_dir" || exit 1
|
||||
local remote="origin"
|
||||
git fetch "$remote" "$branch" 2>/dev/null || true
|
||||
git pull --ff-only "$remote" "$branch" 2>/dev/null || git pull --ff-only "$remote" main
|
||||
) || { err "git pull falló en ${cli_dir}"; return 1; }
|
||||
git fetch "$remote" "$branch" || git fetch "$remote"
|
||||
|
||||
# Repo sembrado con git init local (master sin commits) → alinear con origin/main
|
||||
local cur_branch
|
||||
cur_branch="$(git branch --show-current 2>/dev/null || echo "")"
|
||||
if [[ -z "$cur_branch" || "$cur_branch" == "master" ]] \
|
||||
&& git show-ref --verify --quiet "refs/remotes/${remote}/${branch}"; then
|
||||
git checkout -B "$branch" "${remote}/${branch}"
|
||||
fi
|
||||
|
||||
git branch --set-upstream-to="${remote}/${branch}" "$branch" 2>/dev/null \
|
||||
|| git branch --set-upstream-to="${remote}/${branch}" main 2>/dev/null \
|
||||
|| true
|
||||
|
||||
git pull --ff-only "$remote" "$branch"
|
||||
) || {
|
||||
err "git pull falló en ${cli_dir}"
|
||||
echo -e " ${GRAY}Probá manualmente:${NC}"
|
||||
echo -e " ${GRAY} cd ${cli_dir} && git fetch origin && git checkout -B main origin/main${NC}"
|
||||
echo -e " ${GRAY} git branch --set-upstream-to=origin/main main && git pull${NC}"
|
||||
echo -e " ${GRAY}Si pide usuario/clave: bdt git-auth <usuario-gitlab>${NC}"
|
||||
return 1
|
||||
}
|
||||
ok "Repo actualizado"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user