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:
@@ -52,8 +52,15 @@ full_git_push() {
|
||||
[[ -z "$dir_path" ]] && continue
|
||||
local d="$registry_root/$dir_path"
|
||||
[[ -d "$d" ]] || continue
|
||||
[[ -d "$d/.git" ]] && continue
|
||||
# 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)
|
||||
|
||||
Reference in New Issue
Block a user