Fix submodule update: declare branch, use a relative URL

"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 <noreply@anthropic.com>
This commit is contained in:
andreandClaude Opus 5 committed 2026-09-13 22:03:44 +01:00
1 parent aec7b47820
commit 3626080599
1 file changed
+2 -1
+2 -1
View File
@@ -1,3 +1,4 @@
[submodule "shared/platform-tools"] [submodule "shared/platform-tools"]
path = shared/platform-tools path = shared/platform-tools
url = http://git.andmore.pt/andre/platform-tools.git url = ../platform-tools.git
branch = main