Commit dcc9a8f
fix: generalize
* fix: generalize getGithubBaseUrl to support any git forge
The original implementation only accepted github.com URLs.
This change generalizes it to accept any HTTPS or SSH git remote:
- https://host/org/repo[.git] (GitHub, GitHub Enterprise, Codeberg, Gitea)
- git@host:org/repo.git (any SSH remote)
This fixes srcUri.github failures for:
- GitHub Enterprise (e.g., github.jpl.nasa.gov)
- Codeberg/Forgejo/Gitea (e.g., codeberg.org)
Note: Source links use GitHub's /blob/COMMIT/path convention.
For non-GitHub forges (Codeberg uses /src/commit/), use DOCGEN_SRC=file.
* Apply suggestions from code review
Co-authored-by: Henrik Böving <hargonix@gmail.com>
---------
Co-authored-by: Henrik Böving <hargonix@gmail.com>getGithubBaseUrl to support any github-compatible forge (#381)1 parent 2c96309 commit dcc9a8f
1 file changed
+23
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
95 | 107 | | |
96 | 108 | | |
97 | 109 | | |
| |||
0 commit comments