feature: usar esquema de remoto para host de api gitea

This commit is contained in:
jt
2026-07-09 18:00:39 -03:00
parent 1cc2de0b75
commit ecfe058f8d
2 changed files with 8 additions and 6 deletions
+6 -4
View File
@@ -16,18 +16,20 @@ class RemoteAPI(ABC):
if url.startswith("git@"):
at_pos = url.index("@")
colon_pos = url.index(":")
schema = "ssh://"
host = url[at_pos+1:colon_pos]
repository = url[colon_pos+1:]
elif url.startswith("http://") or url.startswith("https://"):
host_start = url.index("://") + 3
uri_start = url.index("/", host_start)
host = url[host_start:uri_start]
start_pos = url.index("://") + 3
uri_start = url.index("/", start_pos)
schema = url[:start_pos]
host = url[start_pos:uri_start]
repository = url[uri_start+1:]
else:
raise GitFlowError(f"La URL del remoto {remote} es inválida: {url}")
repository = repository.removesuffix(".git")
return [host, repository]
return [schema, host, repository]
@abstractmethod
def create_pull_request(