File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ git-open can automatically guess the corresponding repository page for remotes
128128- Visual Studio Team Services
129129- Team Foundation Server (on-premises)
130130- AWS Code Commit
131+ - cnb.cool
131132
132133## Configuration
133134
Original file line number Diff line number Diff line change @@ -246,8 +246,16 @@ elif [[ "$domain" =~ amazonaws\.com$ ]]; then
246246 # Replace branch ref.
247247 # Ex. /tree/foobar -> foobar/--/
248248 providerBranchRef=" ${providerBranchRef##*/ } /--/"
249+ elif [[ " $domain " =~ cnb\. cool$ ]]; then
250+ # cnb.cool
251+ # Replace URL path.
252+ # Ex. repos/example -> repos/example/-
253+ urlpath=" $urlpath /-"
254+ if [[ $remote_ref = " master" ]]; then
255+ # repos/example/tree/master -> repos/example/-/tree/master
256+ urlpath=" $urlpath$providerBranchRef "
257+ fi
249258fi
250-
251259openurl=" $protocol ://$domain /$urlpath "
252260
253261if (( is_commit )) ; then
Original file line number Diff line number Diff line change @@ -626,6 +626,30 @@ setup() {
626626 assert_output " Issue feature does not supported on AWS Code Commit."
627627}
628628
629+ # #
630+ # # cnb.cool
631+ # #
632+
633+ @test " cnb: https url" {
634+ git remote set-url origin " https://cnb.cool/repos/repo"
635+ git checkout -B " master"
636+ run ../git-open
637+ assert_output " https://cnb.cool/repos/repo/-/tree/master"
638+ }
639+
640+ @test " cnb: branch " {
641+ git remote set-url origin " https://cnb.cool/repos/repo"
642+ git checkout -B " mybranch"
643+ run ../git-open
644+ assert_output " https://cnb.cool/repos/repo/-/tree/mybranch"
645+ }
646+
647+ @test " cnb: issue" {
648+ git remote set-url origin " https://cnb.cool/repos/repo"
649+ git checkout -B " issues/10"
650+ run ../git-open " --issue"
651+ assert_output " https://cnb.cool/repos/repo/-/issues/10"
652+ }
629653
630654teardown () {
631655 cd ..
You can’t perform that action at this time.
0 commit comments