зеркало из https://github.com/mislav/hub.git
Fix `hub browse` help output when not in any repo
This commit is contained in:
Родитель
ba8456b57c
Коммит
fefefa204d
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче