diff options
| author | Carlos Martín Nieto <[email protected]> | 2017-07-07 23:24:54 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2017-07-07 23:24:54 +0200 |
| commit | 5d466ffbc00bc2fbde0f0589c70e23b8fc7cc7d9 (patch) | |
| tree | c7dcab4d5da179ee853d7215801e3c1135707d8e /commit.go | |
| parent | 29c0b730076fe402c22ea3e3a11a7ed541663637 (diff) | |
commit: add thread locking to signature extraction
Diffstat (limited to 'commit.go')
| -rw-r--r-- | commit.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -35,16 +35,18 @@ func (c Commit) ExtractSignature() (string, string, error) { defer C.git_buf_free(&c_signature) oid := c.Id() - repo := C.git_commit_owner(c.cast_ptr) + + runtime.LockOSThread() + defer runtime.UnlockOSThread() ret := C.git_commit_extract_signature(&c_signature, &c_signed, repo, oid.toC(), nil) - + if ret < 0 { - return "", "", MakeGitError(ret) + return "", "", MakeGitError(ret) } else { return C.GoString(c_signature.ptr), C.GoString(c_signed.ptr), nil } - + } func (c Commit) Summary() string { |
