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 5 deletions
Showing only changes of commit bb9dcc7be4 - Show all commits

View File

@ -105,14 +105,10 @@ func commitSignCallback(_signature *C.git_buf, _signature_field *C.git_buf, _com
C._go_git_buf_fill_null(buf) C._go_git_buf_fill_null(buf)
lhchavez commented 2020-08-14 08:59:06 -05:00 (Migrated from github.com)
Review

this needs a C.free(...).

this needs a `C.free(...)`.
mbfr commented 2020-08-14 09:53:21 -05:00 (Migrated from github.com)
Review

Fixed

Fixed
if int(C.git_buf_set(buf, cstr, clen)) != 0 { if int(C.git_buf_set(buf, cstr, clen+1)) != 0 {
return errors.New("could not set buffer") return errors.New("could not set buffer")
} }
// git_buf_set sets 'size' to the 'size' of the buffer to 'clen', but we want it to be clen+1 because after returning it asserts that the buffer ends with a null byte, which Go strings don't
// This avoids having to convert the string to a []byte, then adding a null byte, then doing another copy
buf.size += 1
return nil return nil
} }