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) <noreply@anthropic.com>
This commit is contained in:
2026-05-30 17:34:21 +02:00
parent fd5787c55f
commit dfcb3c46a7
+9 -2
View File
@@ -52,8 +52,15 @@ full_git_push() {
[[ -z "$dir_path" ]] && continue [[ -z "$dir_path" ]] && continue
local d="$registry_root/$dir_path" local d="$registry_root/$dir_path"
[[ -d "$d" ]] || continue [[ -d "$d" ]] || continue
[[ -d "$d/.git" ]] && continue # Skip solo si ya tiene .git CON remote origin. Un .git sin origin
echo " auto-init: $d" >&2 # (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" || \ ensure_repo_synced "$d" dataforge "$(basename "$d")" master "chore: initial sync" || \
echo " [warn] fallo inicializando $d" >&2 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) 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)