1 module deimos.git2.clone; 2 3 import deimos.git2.checkout; 4 import deimos.git2.common; 5 import deimos.git2.indexer; 6 import deimos.git2.remote; 7 import deimos.git2.transport; 8 import deimos.git2.types; 9 import deimos.git2.util; 10 11 extern (C): 12 13 14 enum git_clone_local_t { 15 GIT_CLONE_LOCAL_AUTO, 16 GIT_CLONE_LOCAL, 17 GIT_CLONE_NO_LOCAL, 18 GIT_CLONE_LOCAL_NO_LINKS, 19 } 20 mixin _ExportEnumMembers!git_clone_local_t; 21 22 alias git_remote_create_cb = int function( 23 git_remote **out_, 24 git_repository *repo, 25 const(char)* name, 26 const(char)* url, 27 void *payload, 28 ); 29 alias git_repository_create_cb = int function( 30 git_repository **out_, 31 const(char)* path, 32 int bare, 33 void *payload, 34 ); 35 36 struct git_clone_options { 37 uint version_ = GIT_CLONE_OPTIONS_VERSION; 38 39 git_checkout_options checkout_opts; 40 git_fetch_options fetch_opts; 41 42 int bare; 43 git_clone_local_t local; 44 const(char)* checkout_branch; 45 46 git_repository_create_cb repository_cb; 47 void *repository_cb_payload; 48 git_remote_create_cb remote_cb; 49 void *remote_cb_payload; 50 } 51 52 enum GIT_CLONE_OPTIONS_VERSION = 1; 53 enum git_clone_options GIT_CLONE_OPTIONS_INIT = { 54 GIT_CLONE_OPTIONS_VERSION, 55 { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, 56 GIT_FETCH_OPTIONS_INIT 57 }; 58 59 int git_clone_init_options( 60 git_clone_options *opts, 61 uint version_, 62 ); 63 int git_clone( 64 git_repository **out_, 65 const(char)* url, 66 const(char)* local_path, 67 const(git_clone_options)* options, 68 );