From 469e40ba40e7abc9d9560097cdac3b73caedcde1 Mon Sep 17 00:00:00 2001 From: Egutierrez Date: Sat, 30 May 2026 17:34:21 +0200 Subject: [PATCH] fix(infra): full_git_push auto-init handles .git without origin Auto-init step skipped any dir with .git present, even when it lacked an origin remote. Such dirs fell through to push step and failed with "'origin' does not appear to be a git repository". Now skip only when .git AND origin exist; otherwise run ensure_repo_synced to create the Gitea repo + add origin + push. Co-Authored-By: Claude Opus 4.8 (1M context) --- bash/functions/pipelines/full_git_push.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bash/functions/pipelines/full_git_push.sh b/bash/functions/pipelines/full_git_push.sh index 93f69a20..546ce0dc 100644 --- a/bash/functions/pipelines/full_git_push.sh +++ b/bash/functions/pipelines/full_git_push.sh @@ -52,8 +52,15 @@ full_git_push() { [[ -z "$dir_path" ]] && continue local d="$registry_root/$dir_path" [[ -d "$d" ]] || continue - [[ -d "$d/.git" ]] && continue - echo " auto-init: $d" >&2 + # Skip solo si ya tiene .git CON remote origin. Un .git sin origin + # (init local que nunca llego a crear repo Gitea) cae a push step y + # falla con "'origin' does not appear to be a git repository". + if [[ -d "$d/.git" ]]; then + git -C "$d" remote get-url origin >/dev/null 2>&1 && continue + echo " fix-remote: $d (.git sin origin)" >&2 + else + echo " auto-init: $d" >&2 + fi ensure_repo_synced "$d" dataforge "$(basename "$d")" master "chore: initial sync" || \ echo " [warn] fallo inicializando $d" >&2 done < <(sqlite3 "$registry_root/registry.db" "SELECT dir_path FROM apps WHERE dir_path != '' UNION SELECT dir_path FROM analysis WHERE dir_path != '';" 2>/dev/null)