From 3626080599edd569fcd4cf290ef271b3e2e27ae6 Mon Sep 17 00:00:00 2001 From: andre Date: Sun, 13 Sep 2026 22:03:44 +0100 Subject: [PATCH] Fix submodule update: declare branch, use a relative URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Atualizar submódulo" failed on the server with: fatal: Unable to find refs/remotes/origin/HEAD revision in submodule path 'shared/platform-tools' Two causes, both in .gitmodules. 1. No `branch` key. platform_submodules() falls back to the submodule's refs/remotes/origin/HEAD symbolic ref when .gitmodules does not name a branch. That ref is written by `git remote set-head`, which a plain clone on the server never ran, so the lookup had nothing to resolve. Declaring `branch = main` removes the fallback entirely. platform-tools' default branch is `main`, not `master`. 2. url used http://, which returns 523 from the origin. Switched to the relative form fotografia.andmore.pt already uses: it resolves against this repo's own origin, so it follows whatever host and scheme the parent was cloned with and carries no credentials of its own. .gitmodules now matches the fotografia sibling exactly. The pull that brings this commit in also runs `git submodule sync --recursive` (git_sync_submodules), which is what rewrites the stored URL — no manual step on the server. Co-Authored-By: Claude Opus 5 --- .gitmodules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 1a65c3a..4fcd2e0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "shared/platform-tools"] path = shared/platform-tools - url = http://git.andmore.pt/andre/platform-tools.git + url = ../platform-tools.git + branch = main