11package main
22
33import (
4+ git "github.com/gitjournal/go-git-dart/internal/git"
5+ keygen "github.com/gitjournal/go-git-dart/internal/keygen"
46
57 /*
68 #include <stdlib.h>
@@ -11,7 +13,7 @@ import (
1113
1214//export GitClone
1315func GitClone (url * C.char , directory * C.char , privateKey * C.char , privateKeyLen C.int , password * C.char ) * C.char {
14- err := gitClone (C .GoString (url ), C .GoString (directory ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
16+ err := git . Clone (C .GoString (url ), C .GoString (directory ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
1517 if err != nil {
1618 return C .CString (err .Error ())
1719 }
@@ -21,7 +23,7 @@ func GitClone(url *C.char, directory *C.char, privateKey *C.char, privateKeyLen
2123
2224//export GitFetch
2325func GitFetch (remote * C.char , directory * C.char , privateKey * C.char , privateKeyLen C.int , password * C.char ) * C.char {
24- err := gitFetch (C .GoString (remote ), C .GoString (directory ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
26+ err := git . Fetch (C .GoString (remote ), C .GoString (directory ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
2527 if err != nil {
2628 return C .CString (err .Error ())
2729 }
@@ -31,7 +33,7 @@ func GitFetch(remote *C.char, directory *C.char, privateKey *C.char, privateKeyL
3133
3234//export GitPush
3335func GitPush (remote * C.char , directory * C.char , privateKey * C.char , privateKeyLen C.int , password * C.char ) * C.char {
34- err := gitPush (C .GoString (remote ), C .GoString (directory ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
36+ err := git . Push (C .GoString (remote ), C .GoString (directory ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
3537 if err != nil {
3638 return C .CString (err .Error ())
3739 }
@@ -41,7 +43,7 @@ func GitPush(remote *C.char, directory *C.char, privateKey *C.char, privateKeyLe
4143
4244//export GitDefaultBranch
4345func GitDefaultBranch (remoteUrl * C.char , privateKey * C.char , privateKeyLen C.int , password * C.char , outputBranchName * * C.char ) * C.char {
44- val , err := gitDefaultBranch (C .GoString (remoteUrl ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
46+ val , err := git . DefaultBranch (C .GoString (remoteUrl ), C .GoBytes (unsafe .Pointer (privateKey ), privateKeyLen ), C .GoString (password ))
4547 if err != nil {
4648 return C .CString (err .Error ())
4749 }
@@ -52,7 +54,7 @@ func GitDefaultBranch(remoteUrl *C.char, privateKey *C.char, privateKeyLen C.int
5254
5355//export GJGenerateRSAKeys
5456func GJGenerateRSAKeys (publicKey * * C.char , privateKey * * C.char ) * C.char {
55- publicKeyVal , privateKeyVal , err := generateRSAKeys ()
57+ publicKeyVal , privateKeyVal , err := keygen . GenerateRSAKeys ()
5658 if err != nil {
5759 return C .CString (err .Error ())
5860 }
0 commit comments