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

fix `ci-status` showing the latest status

GitHub API seems to return statuses in reverse-chronological order. The
first one is the latest one.

Fixes #327
上级 ea217d49
......@@ -16,8 +16,8 @@ Feature: hub ci-status
Given there is a commit named "the_sha"
Given the remote commit states of "michiels/pencilbox" "the_sha" are:
"""
[ { :state => 'pending' },
{ :state => 'success' } ]
[ { :state => 'success' },
{ :state => 'pending' } ]
"""
When I run `hub ci-status the_sha`
Then the output should contain exactly "success\n"
......
......@@ -88,7 +88,7 @@ module Hub
end
statuses = api_client.statuses(head_project, sha)
status = statuses.last
status = statuses.first
ref_state = status ? status['state'] : 'no status'
exit_code = case ref_state
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册