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
+11 -1
View File
@@ -166,6 +166,17 @@ def git_gate_render_gitconfig(
for entry in entries:
out.append(f'[url "git://{gate_host}/{entry.Name}.git"]\n')
out.append(f"\tinsteadOf = {entry.Upstream}\n")
if entry.RemoteKey and entry.RemoteKey != entry.UpstreamHost:
port = (
f":{entry.UpstreamPort}"
if entry.UpstreamPort and entry.UpstreamPort != "22"
else ""
)
alias = (
f"ssh://{entry.UpstreamUser}@{entry.RemoteKey}{port}/"
f"{entry.UpstreamPath}"
)
out.append(f"\tinsteadOf = {alias}\n")
return "".join(out)
@@ -404,4 +415,3 @@ class GitGate(ABC):
access_hook_script=access_hook,
upstreams=upstreams,
)