fix(git): rewrite logical ip upstream aliases
test / unit (pull_request) Successful in 27s
test / integration (pull_request) Successful in 41s

This commit is contained in:
2026-05-28 19:50:50 -04:00
parent 1f0434bffc
commit f86349ca92
4 changed files with 38 additions and 1 deletions
+24
View File
@@ -10,6 +10,7 @@ from bot_bottle.git_gate import (
GIT_GATE_HOSTNAME,
git_gate_render_gitconfig,
)
from bot_bottle.manifest import Manifest
from tests.fixtures import fixture_minimal, fixture_with_git
@@ -59,6 +60,29 @@ class TestGitGateGitconfigRender(unittest.TestCase):
'[url "git://192.168.20.2:9418/bot-bottle.git"]', out,
)
def test_ip_upstream_also_rewrites_logical_remote_key(self):
m = Manifest.from_json_obj({
"bottles": {"dev": {"git": {"remotes": {
"gitea.dideric.is": {
"Name": "bot-bottle",
"Upstream": "ssh://git@100.78.141.42:30009/didericis/bot-bottle.git",
"IdentityFile": "/dev/null",
},
}}}},
"agents": {"demo": {"skills": [], "prompt": "", "bottle": "dev"}},
})
out = git_gate_render_gitconfig(m.bottles["dev"].git, GIT_GATE_HOSTNAME)
self.assertIn(
"\tinsteadOf = "
"ssh://git@100.78.141.42:30009/didericis/bot-bottle.git",
out,
)
self.assertIn(
"\tinsteadOf = "
"ssh://git@gitea.dideric.is:30009/didericis/bot-bottle.git",
out,
)
if __name__ == "__main__":
unittest.main()