File tree 3 files changed +34
-1
lines changed
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
128
128
- Visual Studio Team Services
129
129
- Team Foundation Server (on-premises)
130
130
- AWS Code Commit
131
+ - cnb.cool
131
132
132
133
## Configuration
133
134
Original file line number Diff line number Diff line change @@ -246,8 +246,16 @@ elif [[ "$domain" =~ amazonaws\.com$ ]]; then
246
246
# Replace branch ref.
247
247
# Ex. /tree/foobar -> foobar/--/
248
248
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
249
258
fi
250
-
251
259
openurl=" $protocol ://$domain /$urlpath "
252
260
253
261
if (( is_commit )) ; then
Original file line number Diff line number Diff line change @@ -626,6 +626,30 @@ setup() {
626
626
assert_output " Issue feature does not supported on AWS Code Commit."
627
627
}
628
628
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
+ }
629
653
630
654
teardown () {
631
655
cd ..
You can’t perform that action at this time.
0 commit comments