summaryrefslogtreecommitdiff
path: root/credentials.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2019-12-10 22:33:00 +0000
committerCarlos Martín Nieto <[email protected]>2019-12-10 22:33:00 +0000
commitc5159e624e55cb14c56a3e5f36200be409fba9d6 (patch)
treed7b16f854db35a2ae348bc1eaa11ba860f37c966 /credentials.go
parentce19fa064f3cb3ef6c4b360076ffc17556b2cc3c (diff)
credentials: unconfuse Go about the type
For some reason cgo thinks the `credtype` field does not exist in `git_cred` so let's put it into the C code.
Diffstat (limited to 'credentials.go')
-rw-r--r--credentials.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/credentials.go b/credentials.go
index 766619c..038313b 100644
--- a/credentials.go
+++ b/credentials.go
@@ -3,6 +3,8 @@ package git
/*
#include <git2.h>
#include <git2/sys/cred.h>
+
+git_credtype_t _go_git_cred_credtype(git_cred *cred);
*/
import "C"
import "unsafe"
@@ -28,7 +30,7 @@ func (o *Cred) HasUsername() bool {
}
func (o *Cred) Type() CredType {
- return (CredType)(o.ptr.credtype)
+ return (CredType)(C._go_git_cred_credtype(o.ptr))
}
func credFromC(ptr *C.git_cred) *Cred {