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

Merge pull request #1413 from vermiculus/show-pulls-again

Add option to show pull requests again
......@@ -130,6 +130,9 @@ With no arguments, show a list of open issues.
-^ --sort-ascending
Sort by ascending dates instead of descending.
--include-pulls
Include pull requests as well as issues.
`,
}
......@@ -156,6 +159,7 @@ With no arguments, show a list of open issues.
flagIssueCopy,
flagIssueBrowse,
flagIssueSortAscending bool
flagIssueIncludePulls bool
flagIssueMilestone uint64
......@@ -183,6 +187,7 @@ func init() {
cmdIssue.Flag.StringVarP(&flagIssueSince, "since", "d", "", "DATE")
cmdIssue.Flag.StringVarP(&flagIssueSort, "sort", "o", "created", "SORT_KEY")
cmdIssue.Flag.BoolVarP(&flagIssueSortAscending, "sort-ascending", "^", false, "SORT_KEY")
cmdIssue.Flag.BoolVarP(&flagIssueIncludePulls, "include-pulls", "", false, "INCLUDE_PULLS")
cmdIssue.Use(cmdCreateIssue)
CmdRunner.Use(cmdIssue)
......@@ -240,7 +245,7 @@ func listIssues(cmd *Command, args *Args) {
colorize := ui.IsTerminal(os.Stdout)
for _, issue := range issues {
if issue.PullRequest != nil {
if !flagIssueIncludePulls && issue.PullRequest != nil {
continue
}
......
......@@ -12,6 +12,12 @@ Feature: hub issue
:direction => nil
json [
{ :number => 999,
:title => "First pull",
:state => "open",
:user => { :login => "octocat" },
:pull_request => { },
},
{ :number => 102,
:title => "First issue",
:state => "open",
......@@ -32,6 +38,42 @@ Feature: hub issue
#13 Second issue\n
"""
Scenario: Fetch issues and pull requests
Given the GitHub API server:
"""
get('/repos/github/hub/issues') {
assert :assignee => "Cornwe19",
:sort => nil,
:direction => nil
json [
{ :number => 999,
:title => "First pull",
:state => "open",
:user => { :login => "octocat" },
:pull_request => { },
},
{ :number => 102,
:title => "First issue",
:state => "open",
:user => { :login => "octocat" },
},
{ :number => 13,
:title => "Second issue",
:state => "open",
:user => { :login => "octocat" },
},
]
}
"""
When I successfully run `hub issue -a Cornwe19 --include-pulls`
Then the output should contain exactly:
"""
#999 First pull
#102 First issue
#13 Second issue\n
"""
Scenario: Fetch issues not assigned to any milestone
Given the GitHub API server:
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册