mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-09 23:16:25 -04:00
Add gitea support (#184)
This commit is contained in:
parent
f772364eb8
commit
281dad270e
7
git-open
7
git-open
|
|
@ -168,6 +168,7 @@ function getConfig() {
|
|||
|
||||
domain=$(getConfig "domain")
|
||||
protocol=$(getConfig "protocol")
|
||||
forge=$(getConfig "forge")
|
||||
|
||||
# Remote ref to open
|
||||
remote_ref=${upstream_branch:-${branch:-$(git describe --tags --exact-match 2>/dev/null || git rev-parse HEAD)}}
|
||||
|
|
@ -183,7 +184,11 @@ else
|
|||
# Make # and % characters url friendly
|
||||
# github.com/paulirish/git-open/pull/24
|
||||
remote_ref=${remote_ref//%/%25} remote_ref=${remote_ref//#/%23}
|
||||
providerBranchRef="/tree/$remote_ref"
|
||||
if [[ $forge == 'gitea' ]]; then
|
||||
providerBranchRef="/src/branch/$remote_ref"
|
||||
else
|
||||
providerBranchRef="/tree/$remote_ref"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$domain" == 'bitbucket.org' ]]; then
|
||||
|
|
|
|||
|
|
@ -118,6 +118,20 @@ git config open.default.remote upstream
|
|||
This is equivalent to always typing `git open upstream`.
|
||||
|
||||
|
||||
### Gitea options
|
||||
|
||||
To configure Gitea support you need to set the following option.
|
||||
|
||||
`open.[gitdomain].forge`
|
||||
The git forge present at the git domain. This only needs to be set for Gitea because it uses another branch URL format.
|
||||
|
||||
**Example**
|
||||
|
||||
```sh
|
||||
git config [--global] "open.https://gitea.internal.biz.forge" "gitea"
|
||||
```
|
||||
|
||||
|
||||
### GitLab options
|
||||
|
||||
To configure GitLab support (or other unique hosting situations) you may need to set some options.
|
||||
|
|
|
|||
Loading…
Reference in a new issue