@@ -92,26 +92,30 @@ elif grep -q "/scm/" <<<$giturl; then
92
92
else
93
93
# custom GitLab
94
94
gitlab_domain=$( git config --get gitopen.gitlab.domain)
95
- gitlab_port=$( git config --get gitopen.gitlab.port)
95
+ gitlab_ssh_domain=$( git config --get gitopen.gitlab.ssh.domain)
96
+ gitlab_ssh_domain=${gitlab_ssh_domain:- $gitlab_domain }
97
+ gitlab_ssh_port=$( git config --get gitopen.gitlab.ssh.port)
98
+
96
99
gitlab_protocol=$( git config --get gitopen.gitlab.protocol)
97
100
if [ -z " $gitlab_protocol " ]; then
98
101
gitlab_protocol=http
99
102
fi
100
- if [ -n " $gitlab_domain " ]; then
101
- if grep -q " $gitlab_domain " <<< $giturl ; then
103
+
104
+ if [ -n " $gitlab_domain " ]; then
105
+ if egrep -q " ${gitlab_domain} |${gitlab_ssh_domain} " <<< $giturl ; then
102
106
103
107
# Handle GitLab's default SSH notation (like git@gitlab.domain.com:user/repo)
104
- giturl=${giturl/ git\@ ${gitlab_domain } \: / ${gitlab_protocol} :// ${gitlab_domain} / }
108
+ giturl=${giturl/ git\@ ${gitlab_ssh_domain } \: / ${gitlab_protocol} :// ${gitlab_domain} / }
105
109
106
110
# handle SSH protocol (links like ssh://git@gitlab.domain.com/user/repo)
107
111
giturl=${giturl/# ssh\:\/\/ / ${gitlab_protocol} :// }
108
112
109
113
# remove git@ from the domain
110
- giturl=${giturl/ git\@ ${gitlab_domain } / ${gitlab_domain} / }
114
+ giturl=${giturl/ git\@ ${gitlab_ssh_domain } / ${gitlab_domain} / }
111
115
112
116
# remove SSH port
113
- if [ -n " $gitlab_port " ]; then
114
- giturl=${giturl/ \/ : ${gitlab_port } \/ // }
117
+ if [ -n " $gitlab_ssh_port " ]; then
118
+ giturl=${giturl/ \/ : ${gitlab_ssh_port } \/ // }
115
119
fi
116
120
providerUrlDifference=tree
117
121
fi
0 commit comments