Fix `hub browse` help output when not in any repo

This commit is contained in:
Mislav Marohnić 2014-07-25 21:08:31 -07:00
Родитель ba8456b57c
Коммит fefefa204d
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -2,6 +2,11 @@ Feature: hub browse
Background:
Given I am "mislav" on github.com with OAuth token "OTOKEN"
Scenario: No repo
When I run `hub browse`
Then the exit status should be 1
Then the output should contain exactly "Usage: hub browse [<USER>/]<REPOSITORY>\n"
Scenario: Project with owner
When I successfully run `hub browse mislav/dotfiles`
Then there should be no output

Просмотреть файл

@ -690,7 +690,7 @@ module Hub
elsif subpage && !%w[commits tree blob settings].include?(subpage)
branch = master_branch
project = local_repo.main_project
else
elsif local_repo(false)
# $ hub browse
prefer_upstream = current_branch && current_branch.master?
branch, project = remote_branch_and_project(method(:github_user), prefer_upstream)