Compare commits
1 Commits
main
...
cmn/oid-co
Author | SHA1 | Date |
---|---|---|
|
a333fd9a49 |
5
git.go
5
git.go
|
@ -3,7 +3,7 @@ package git
|
||||||
/*
|
/*
|
||||||
#cgo pkg-config: libgit2
|
#cgo pkg-config: libgit2
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
#include <git2/errors.h>
|
#include <string.h>
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
|
@ -38,7 +38,8 @@ func newOidFromC(coid *C.git_oid) *Oid {
|
||||||
}
|
}
|
||||||
|
|
||||||
oid := new(Oid)
|
oid := new(Oid)
|
||||||
copy(oid[0:20], C.GoBytes(unsafe.Pointer(coid), 20))
|
|
||||||
|
C.memcpy(unsafe.Pointer(oid), unsafe.Pointer(coid), 20)
|
||||||
return oid
|
return oid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue