From 97e6392d3ab67bbf3e3e59b86a0bc9ebf7430e98 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Tue, 10 Dec 2019 22:15:32 +0000 Subject: Adjust to libgit2 changes --- credentials.go | 1 + 1 file changed, 1 insertion(+) (limited to 'credentials.go') diff --git a/credentials.go b/credentials.go index 4e42b6e..766619c 100644 --- a/credentials.go +++ b/credentials.go @@ -2,6 +2,7 @@ package git /* #include +#include */ import "C" import "unsafe" -- cgit v1.2.3 From c5159e624e55cb14c56a3e5f36200be409fba9d6 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Tue, 10 Dec 2019 22:33:00 +0000 Subject: 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. --- credentials.go | 4 +++- wrapper.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'credentials.go') 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 #include + +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 { diff --git a/wrapper.c b/wrapper.c index 11c2f32..3656773 100644 --- a/wrapper.c +++ b/wrapper.c @@ -2,6 +2,7 @@ #include #include #include +#include typedef int (*gogit_submodule_cbk)(git_submodule *sm, const char *name, void *payload); @@ -180,4 +181,8 @@ void _go_git_writestream_free(git_writestream *stream) stream->free(stream); } +git_credtype_t _go_git_cred_credtype(git_cred *cred) { + return cred->credtype; +} + /* EOF */ -- cgit v1.2.3