MCPcopy Index your code
hub / github.com/git-bug/git-bug / BugCreateEditorInput

Function BugCreateEditorInput

commands/bug/input/input.go:32–45  ·  view source on GitHub ↗

BugCreateEditorInput will open the default editor in the terminal with a template for the user to fill. The file is then processed to extract title and message.

(repo repository.RepoCommonStorage, preTitle string, preMessage string)

Source from the content-addressed store, hash-verified

30// template for the user to fill. The file is then processed to extract title
31// and message.
32func BugCreateEditorInput(repo repository.RepoCommonStorage, preTitle string, preMessage string) (string, string, error) {
33 if preMessage != "" {
34 preMessage = "\n\n" + preMessage
35 }
36
37 template := fmt.Sprintf(bugTitleCommentTemplate, preTitle, preMessage)
38
39 raw, err := input.LaunchEditorWithTemplate(repo, messageFilename, template)
40 if err != nil {
41 return "", "", err
42 }
43
44 return processCreate(raw)
45}
46
47// BugCreateFileInput read from either from a file or from the standard input
48// and extract a title and a message

Callers

nothing calls this directly

Calls 2

LaunchEditorWithTemplateFunction · 0.92
processCreateFunction · 0.85

Tested by

no test coverage detected