Add support for creating signed commits and signing commits during a rebase #626

Merged
mbfr merged 25 commits from master into master 2020-08-18 11:25:31 -05:00
1 changed files with 1 additions and 0 deletions
Showing only changes of commit 0c942dbd89 - Show all commits

View File

@ -95,6 +95,7 @@ func commitSignCallback(_signature *C.git_buf, _signature_field *C.git_buf, _com
fillBuf := func(bufData string, buf *C.git_buf) error {
clen := C.size_t(len(bufData))
cstr := unsafe.Pointer(C.CString(bufData))
defer C.free(cstr)
// over-assign by a byte (see below)
if int(C.git_buf_grow(buf, clen+1)) != 0 {
lhchavez commented 2020-08-14 08:58:38 -05:00 (Migrated from github.com)
Review

in order to support callback authors being able to set a specific libgit2 error, we could do something like:

if gitError, ok := err.(*GitError); ok {
    return C.int(gitError.Code)
}
return C.int(-1)
in order to support callback authors being able to set a specific libgit2 error, we could do something like: ```go if gitError, ok := err.(*GitError); ok { return C.int(gitError.Code) } return C.int(-1) ```
mbfr commented 2020-08-14 09:53:17 -05:00 (Migrated from github.com)
Review

Good idea, added

Good idea, added