MCPcopy Create free account
hub / github.com/libgit2/git2go / Message

Method Message

repository.go:816–829  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

814// Use this function to get the contents of this file. Don't forget to remove
815// the file after you create the commit.
816func (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.
832func (r *Repository) RemoveMessage() error {

Callers

nothing calls this directly

Calls 1

MakeGitErrorFunction · 0.85

Tested by

no test coverage detected