diff --git a/README.md b/README.md index 0b84634..dec489d 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ Type `git open` to open the repo website (GitHub, GitLab, Bitbucket) in your bro ```sh git open [remote-name] [branch-name] -git open issue +git open --issue ``` -(`git open` works with these [hosted repo providers](#supported-remote-repositories), `git open issue` currently only works with GitHub) +(`git open` works with these [hosted repo providers](#supported-remote-repositories), `git open --issue` currently only works with GitHub) ### Examples @@ -26,7 +26,7 @@ $ git open someremote $ git open someremote somebranch # opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/tree/PROVIDED_BRANCH -$ git open issue +$ git open --issue # If branches use naming convention of issues/#123, # opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/issues/123 ``` diff --git a/git-open b/git-open index 0f74a70..edb1f8f 100755 --- a/git-open +++ b/git-open @@ -11,7 +11,6 @@ OPTIONS_KEEPDASHDASH= OPTIONS_SPEC="\ git open [options] git open [remote] [branch] -git open issue -- Opens the GitHub page for a repo/branch in your browser. https://github.com/paulirish/git-open/ @@ -42,14 +41,6 @@ if ! git rev-parse --is-inside-work-tree &>/dev/null; then exit 1 fi -# If the first argument is 'issue', we want to load the issue page -if [[ "$1" == 'issue' ]]; then - is_issue=1 - - # Allow the user to provide other args, aka `git open issue upstream 79` - shift -fi - # choose remote. priority to: provided argument, detected tracked remote, 'origin' branch_name=$(git name-rev --name-only HEAD 2>/dev/null) tracked_remote=$(git config "branch.$branch_name.remote") diff --git a/test/git-open.bats b/test/git-open.bats index 8521005..3401349 100755 --- a/test/git-open.bats +++ b/test/git-open.bats @@ -89,19 +89,13 @@ setup() { assert_output "https://github.com/user/repo" } -@test "gh: git open issue" { +@test "gh: git open --issue" { # https://github.com/paulirish/git-open/pull/46 git remote set-url origin "github.com:paulirish/git-open.git" git checkout -B "issues/#12" - run ../git-open "issue" + run ../git-open "--issue" assert_output "https://github.com/paulirish/git-open/issues/12" - # https://github.com/paulirish/git-open/pull/86 - git checkout -B "fix-issue-36" - run ../git-open "issue" - assert_output "https://github.com/paulirish/git-open/issues/36" - - # -i and --issue git checkout -B "fix-issue-37" run ../git-open "--issue" assert_output "https://github.com/paulirish/git-open/issues/37"