#!/usr/bin/env bash
set -e
echo "=== Add safe.directory exception for root ==="
git config --global --add safe.directory /var/www/html/account
echo ""
echo "=== Verify git works clean from /var/www/html/account ==="
cd /var/www/html/account
git log --oneline -3
echo ""
echo "=== git status ==="
git status
echo ""
echo "=== List old snapshots (free to clean up once confident) ==="
ls -la /var/www/html/ | grep -E "account.bak-" || echo "(none)"
echo ""
echo "=== Smoke ==="
curl -s -o /dev/null -w "  /        %{http_code}\n" https://account.allgifted.com/
curl -s -o /dev/null -w "  /login   %{http_code}\n" https://account.allgifted.com/login
