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

Support use of `-m '' --edit` combination

上级 ab6b1fea
......@@ -317,6 +317,30 @@ Feature: hub issue
https://github.com/github/hub/issues/1337\n
"""
Scenario: Editing empty issue message
Given the git commit editor is "vim"
And the text editor adds:
"""
hello
my nice issue
"""
Given the GitHub API server:
"""
post('/repos/github/hub/issues') {
assert :title => "hello",
:body => "my nice issue"
status 201
json :html_url => "https://github.com/github/hub/issues/1337"
}
"""
When I successfully run `hub issue create -m '' --edit`
Then the output should contain exactly:
"""
https://github.com/github/hub/issues/1337\n
"""
Scenario: Issue template
Given the git commit editor is "vim"
And the text editor adds:
......
......@@ -108,8 +108,7 @@ func (e *Editor) openAndEdit() (content []byte, err error) {
}
func (e *Editor) writeContent() (err error) {
// only write message if file doesn't exist
if !e.isFileExist() && e.Message != "" {
if !e.isFileExist() {
err = ioutil.WriteFile(e.File, []byte(e.Message), 0644)
if err != nil {
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册