Remove command 'issue'

Use --issue instead
This commit is contained in:
Love F 2017-10-30 20:37:20 +01:00
parent b25348e368
commit 75e455c0bb
3 changed files with 5 additions and 20 deletions

View file

@ -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
```

View file

@ -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")

View file

@ -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"