[core] Add Codeberg as a supported git url (#16501)
This commit is contained in:
1 parent
e64b6bc398
commit
911e330c09
1 file changed
+3
@@ -341,6 +341,7 @@ def clone_or_update(
|
||||
|
||||
|
||||
GIT_DOMAINS = {
|
||||
"codeberg": "codeberg.org",
|
||||
"github": "github.com",
|
||||
"gitlab": "gitlab.com",
|
||||
}
|
||||
@@ -363,6 +364,8 @@ class GitFile:
|
||||
def raw_url(self) -> str:
|
||||
if self.ref is None:
|
||||
raise ValueError("URL has no ref")
|
||||
if self.domain == "codeberg.org":
|
||||
return f"https://codeberg.org/{self.owner}/{self.repo}/raw/commit/{self.ref}/{self.filename}"
|
||||
if self.domain == "github.com":
|
||||
return f"https://raw.githubusercontent.com/{self.owner}/{self.repo}/{self.ref}/{self.filename}"
|
||||
if self.domain == "gitlab.com":
|
||||
|
||||
Reference in new issue
Block a user