Projects STRLCPY git-open Commits 2ef17f07
🤬
  • ■ ■ ■ ■ ■
    git-open
    skipped 197 lines
    198 198   fi
    199 199  elif [[ "$domain" =~ amazonaws\.com$ ]]; then
    200 200   # AWS Code Commit
     201 + if (( is_issue )); then
     202 + echo "Issue feature does not supported on AWS Code Commit." 1>&2
     203 + exit 1
     204 + fi
     205 + 
    201 206   # Take region name from domain.
    202 207   region=${domain#*.}
    203 208   region=${region%%.*}
    skipped 48 lines
  • ■ ■ ■ ■ ■ ■
    test/git-open.bats
    skipped 502 lines
    503 503   assert_output "https://gitopen.visualstudio.com/Project/_workitems?id=36"
    504 504  }
    505 505   
     506 +##
     507 +## AWS Code Commit
     508 +##
     509 + 
     510 +@test "aws: https url" {
     511 + git remote set-url origin "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
     512 + git checkout -B "master"
     513 + run ../git-open
     514 + assert_output "https://us-east-1.console.aws.amazon.com/codecommit/home?region=us-east-1#/repository/repo/browse/"
     515 +}
     516 + 
     517 +@test "aws: ssh url" {
     518 + git remote set-url origin "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
     519 + git checkout -B "master"
     520 + run ../git-open
     521 + assert_output "https://us-east-1.console.aws.amazon.com/codecommit/home?region=us-east-1#/repository/repo/browse/"
     522 +}
     523 + 
     524 +@test "aws: branch " {
     525 + git remote set-url origin "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
     526 + git checkout -B "mybranch"
     527 + run ../git-open
     528 + assert_output "https://us-east-1.console.aws.amazon.com/codecommit/home?region=us-east-1#/repository/repo/browse/mybranch/--/"
     529 +}
     530 + 
     531 +@test "aws: issue" {
     532 + git remote set-url origin "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
     533 + git checkout -B "issues/#12"
     534 + run ../git-open "--issue"
     535 + [ "$status" -eq 1 ]
     536 + assert_output "Issue feature does not supported on AWS Code Commit."
     537 +}
     538 + 
    506 539   
    507 540  teardown() {
    508 541   cd ..
    skipped 92 lines
Please wait...
Page is in error, reload to recover