1 module git2.remote; 2 3 import git2.common; 4 import git2.indexer; 5 import git2.net; 6 import git2.oid; 7 import git2.refspec; 8 import git2.repository; 9 import git2.strarray; 10 import git2.util; 11 import git2.transport; 12 import git2.types; 13 14 extern (C): 15 16 alias git_remote_rename_problem_cb = int function(const(char)* problematic_refspec, void *payload); 17 18 int git_remote_create( 19 git_remote **out_, 20 git_repository *repo, 21 const(char)* name, 22 const(char)* url); 23 int git_remote_create_inmemory( 24 git_remote **out_, 25 git_repository *repo, 26 const(char)* fetch, 27 const(char)* url); 28 int git_remote_load(git_remote **out_, git_repository *repo, const(char)* name); 29 int git_remote_save(const(git_remote)* remote); 30 const(char)* git_remote_name(const(git_remote)* remote); 31 const(char)* git_remote_url(const(git_remote)* remote); 32 const(char)* git_remote_pushurl(const(git_remote)* remote); 33 int git_remote_set_url(git_remote *remote, const(char)* url); 34 int git_remote_set_pushurl(git_remote *remote, const(char)* url); 35 int git_remote_add_fetch(git_remote *remote, const(char)* refspec); 36 int git_remote_get_fetch_refspecs(git_strarray *array, git_remote *remote); 37 int git_remote_add_push(git_remote *remote, const(char)* refspec); 38 int git_remote_get_push_refspecs(git_strarray *array, git_remote *remote); 39 void git_remote_clear_refspecs(git_remote *remote); 40 size_t git_remote_refspec_count(git_remote *remote); 41 const(git_refspec)* git_remote_get_refspec(git_remote *remote, size_t n); 42 int git_remote_remove_refspec(git_remote *remote, size_t n); 43 int git_remote_connect(git_remote *remote, git_direction direction); 44 int git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void *payload); 45 int git_remote_download( 46 git_remote *remote, 47 git_transfer_progress_callback progress_cb, 48 void *payload); 49 int git_remote_connected(git_remote *remote); 50 void git_remote_stop(git_remote *remote); 51 void git_remote_disconnect(git_remote *remote); 52 void git_remote_free(git_remote *remote); 53 int git_remote_update_tips(git_remote *remote); 54 int git_remote_valid_url(const(char)* url); 55 int git_remote_supported_url(const(char)* url); 56 int git_remote_list(git_strarray *out_, git_repository *repo); 57 void git_remote_check_cert(git_remote *remote, int check); 58 void git_remote_set_cred_acquire_cb( 59 git_remote *remote, 60 git_cred_acquire_cb cred_acquire_cb, 61 void *payload); 62 int git_remote_set_transport( 63 git_remote *remote, 64 git_transport *transport); 65 66 enum git_remote_completion_type { 67 GIT_REMOTE_COMPLETION_DOWNLOAD, 68 GIT_REMOTE_COMPLETION_INDEXING, 69 GIT_REMOTE_COMPLETION_ERROR, 70 } 71 72 mixin _ExportEnumMembers!git_remote_completion_type; 73 74 struct git_remote_callbacks { 75 uint version_ = GIT_REMOTE_CALLBACKS_VERSION; 76 void function(const(char)* str, int len, void *data) progress; 77 int function(git_remote_completion_type type, void *data) completion; 78 int function(const(char)* refname, const(git_oid)* a, const(git_oid)* b, void *data) update_tips; 79 void *payload; 80 } 81 82 enum GIT_REMOTE_CALLBACKS_VERSION = 1; 83 enum git_remote_callbacks GIT_REMOTE_CALLBACKS_INIT = { GIT_REMOTE_CALLBACKS_VERSION }; 84 85 int git_remote_set_callbacks(git_remote *remote, git_remote_callbacks *callbacks); 86 87 const(git_transfer_progress)* git_remote_stats(git_remote *remote); 88 89 enum git_remote_autotag_option_t { 90 GIT_REMOTE_DOWNLOAD_TAGS_AUTO = 0, 91 GIT_REMOTE_DOWNLOAD_TAGS_NONE = 1, 92 GIT_REMOTE_DOWNLOAD_TAGS_ALL = 2 93 } 94 95 mixin _ExportEnumMembers!git_remote_autotag_option_t; 96 97 git_remote_autotag_option_t git_remote_autotag(git_remote *remote); 98 void git_remote_set_autotag( 99 git_remote *remote, 100 git_remote_autotag_option_t value); 101 int git_remote_rename( 102 git_remote *remote, 103 const(char)* new_name, 104 git_remote_rename_problem_cb callback, 105 void *payload); 106 int git_remote_update_fetchhead(git_remote *remote); 107 void git_remote_set_update_fetchhead(git_remote *remote, int value); 108 int git_remote_is_valid_name(const(char)* remote_name);