Fix patch num hunk without patch.ptr
This commit is contained in:
parent
83584f0fef
commit
f1ece8650b
2
patch.go
2
patch.go
|
@ -61,7 +61,7 @@ func (patch *Patch) NumHunks() (int, error) {
|
||||||
if patch.ptr == nil {
|
if patch.ptr == nil {
|
||||||
return -1, ErrInvalid
|
return -1, ErrInvalid
|
||||||
}
|
}
|
||||||
ret := int(C.git_patch_num_hunks())
|
ret := int(C.git_patch_num_hunks(patch.ptr))
|
||||||
runtime.KeepAlive(patch)
|
runtime.KeepAlive(patch)
|
||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue