This commit is contained in:
Mislav Marohnić 2020-01-21 12:48:56 +01:00
Родитель b0db79dbf3
Коммит f988235f74
2 изменённых файлов: 20 добавлений и 4 удалений

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

@ -20,7 +20,7 @@ var (
issue [-a <ASSIGNEE>] [-c <CREATOR>] [-@ <USER>] [-s <STATE>] [-f <FORMAT>] [-M <MILESTONE>] [-l <LABELS>] [-d <DATE>] [-o <SORT_KEY> [-^]] [-L <LIMIT>]
issue show [-f <FORMAT>] <NUMBER>
issue create [-oc] [-m <MESSAGE>|-F <FILE>] [--edit] [-a <USERS>] [-M <MILESTONE>] [-l <LABELS>]
issue update <NUMBER> [-m <MESSAGE>|-F <FILE>] [--edit] [-a <USERS>] [-M <MILESTONE>] [-l <LABELS>]
issue update <NUMBER> [-m <MESSAGE>|-F <FILE>] [--edit] [-a <USERS>] [-M <MILESTONE>] [-l <LABELS>] [-s <STATE>]
issue labels [--color]
issue transfer <NUMBER> <REPO>
`,
@ -243,6 +243,7 @@ hub-pr(1), hub(1)
-l, --labels LIST
-a, --assign USER
-e, --edit
-s, --state STATE
`,
}
)
@ -635,7 +636,7 @@ func updateIssue(cmd *Command, args *Args) {
if issueNumber == 0 {
utils.Check(cmd.UsageError(""))
}
if !hasField(args, "--message", "--file", "--labels", "--milestone", "--assign", "--edit") {
if !hasField(args, "--message", "--file", "--labels", "--milestone", "--assign", "--state", "--edit") {
utils.Check(cmd.UsageError("please specify fields to update"))
}
@ -652,6 +653,10 @@ func updateIssue(cmd *Command, args *Args) {
setAssigneesFromArgs(params, args)
setMilestoneFromArgs(params, args, gh, project)
if args.Flag.HasReceived("--state") {
params["state"] = args.Flag.Value("--state")
}
if hasField(args, "--message", "--file", "--edit") {
messageBuilder := &github.MessageBuilder{
Filename: "ISSUE_EDITMSG",

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

@ -593,7 +593,6 @@ Feature: hub issue
https://github.com/github/hub/issues/1337\n
"""
Scenario: Update an issue's title
Given the GitHub API server:
"""
@ -602,11 +601,23 @@ Feature: hub issue
:body => "",
:milestone => :no,
:assignees => :no,
:labels => :no
:labels => :no,
:state => :no
}
"""
Then I successfully run `hub issue update 1337 -m "Not workie, pls fix"`
Scenario: Update an issue's state
Given the GitHub API server:
"""
patch('/repos/github/hub/issues/1337') {
assert :title => :no,
:labels => :no,
:state => "closed"
}
"""
Then I successfully run `hub issue update 1337 -s closed`
Scenario: Update an issue's labels
Given the GitHub API server:
"""