提交 97506154 编写于 作者: M Mislav Marohnić

Fix inferred `pull-request` head for usernames with capital letters

Fixes #1256
上级 3ab56f59
......@@ -630,6 +630,24 @@ BODY
When I successfully run `hub pull-request -m hereyougo`
Then the output should contain exactly "the://url\n"
Scenario: Create pull request from branch on the personal fork, capitalized
Given the "origin" remote has url "git://github.com/LightAlf/FirstRepo.git"
And the "Kristinita" remote has url "git@github.com:Kristinita/FirstRepo.git"
And I am on the "add-py3kwarn" branch pushed to "Kristinita/add-py3kwarn"
And I am "Kristinita" on github.com with OAuth token "OTOKEN"
Given the GitHub API server:
"""
post('/repos/LightAlf/FirstRepo/pulls') {
assert :base => 'master',
:head => 'Kristinita:add-py3kwarn',
:title => 'hereyougo'
status 201
json :html_url => "the://url"
}
"""
When I successfully run `hub pull-request -m hereyougo`
Then the output should contain exactly "the://url\n"
Scenario: Create pull request to "upstream" remote
Given the "upstream" remote has url "git://github.com/github/coral.git"
And I am on the "master" branch pushed to "origin/master"
......
......@@ -57,7 +57,7 @@ func (r *GitHubRepo) remotesForPublish(owner string) (remotes []Remote) {
if owner != "" {
for _, remote := range r.remotes {
p, e := remote.Project()
if e == nil && strings.ToLower(p.Owner) == owner {
if e == nil && strings.EqualFold(p.Owner, owner) {
remotesMap[remote.Name] = remote
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册