From 26df57da1882896afca87a85003b7c074d114a64 Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 25 Mar 2026 15:23:02 +0000 Subject: [PATCH] fix: skip push when local repo has no commits (empty clone) The smoke test clones from an empty Forgejo repo, so there are no refs to push. Skip the push and verification gracefully when HEAD does not resolve. Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/disinto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/disinto b/bin/disinto index 0769d75..e6e1f97 100755 --- a/bin/disinto +++ b/bin/disinto @@ -674,6 +674,12 @@ push_to_forge() { fi echo "Remote: forgejo -> ${display_url}" + # Skip push if local repo has no commits (e.g. cloned from empty Forgejo repo) + if ! git -C "$repo_root" rev-parse HEAD >/dev/null 2>&1; then + echo "Push: skipped (local repo has no commits)" + return 0 + fi + # Push all branches and tags echo "Pushing: branches to forgejo" if ! git -C "$repo_root" push forgejo --all 2>&1; then