Message retrieves git's prepared message. Operations such as git revert/cherry-pick/merge with the -n option stop just short of creating a commit with the changes and save their prepared message in .git/MERGE_MSG so the next git-commit execution can present it to the user for them to amend if they w
()
| 814 | // Use this function to get the contents of this file. Don't forget to remove |
| 815 | // the file after you create the commit. |
| 816 | func (r *Repository) Message() (string, error) { |
| 817 | buf := C.git_buf{} |
| 818 | defer C.git_buf_dispose(&buf) |
| 819 | |
| 820 | runtime.LockOSThread() |
| 821 | defer runtime.UnlockOSThread() |
| 822 | |
| 823 | cErr := C.git_repository_message(&buf, r.ptr) |
| 824 | runtime.KeepAlive(r) |
| 825 | if cErr < 0 { |
| 826 | return "", MakeGitError(cErr) |
| 827 | } |
| 828 | return C.GoString(buf.ptr), nil |
| 829 | } |
| 830 | |
| 831 | // RemoveMessage removes git's prepared message. |
| 832 | func (r *Repository) RemoveMessage() error { |
nothing calls this directly
no test coverage detected