diff options
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/remote.h | 48 | ||||
| -rw-r--r-- | include/git2/repository.h | 2 | ||||
| -rw-r--r-- | include/git2/transport.h | 8 | ||||
| -rw-r--r-- | include/git2/tree.h | 3 |
4 files changed, 43 insertions, 18 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index 54116c22e..43bbe9e1c 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -28,16 +28,18 @@ GIT_BEGIN_DECL */ /** - * Create a new unnamed remote + * Create a remote in memory * - * Useful when you don't want to store the remote + * Create a remote with the default refspecs in memory. You can use + * this when you have a URL instead of a remote's name. * * @param out pointer to the new remote object * @param repo the associtated repository * @param url the remote repository's URL + * @param name the remote's name * @return GIT_SUCCESS or an error code */ -int git_remote_new(git_remote **out, git_repository *repo, const char *url); +int git_remote_new(git_remote **out, git_repository *repo, const char *url, const char *name); /** * Get the information for a particular remote @@ -98,7 +100,8 @@ GIT_EXTERN(int) git_remote_connect(struct git_remote *remote, int direction); /** * Get a list of refs at the remote * - * The remote (or more exactly its transport) must be connected. + * The remote (or more exactly its transport) must be connected. The + * memory belongs to the remote. * * @param refs where to store the refs * @param remote the remote @@ -107,20 +110,13 @@ GIT_EXTERN(int) git_remote_connect(struct git_remote *remote, int direction); GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headarray *refs); /** - * Negotiate what data needs to be exchanged to synchroize the remtoe - * and local references - * - * @param remote the remote you want to negotiate with - */ -GIT_EXTERN(int) git_remote_negotiate(git_remote *remote); - -/** * Download the packfile * - * The packfile is downloaded with a temporary filename, as it's final - * name is not known yet. If there was no packfile needed (all the - * objects were available locally), filename will be NULL and the - * function will return success. + * Negotiate what objects should be downloaded and download the + * packfile with those objects. The packfile is downloaded with a + * temporary filename, as it's final name is not known yet. If there + * was no packfile needed (all the objects were available locally), + * filename will be NULL and the function will return success. * * @param remote the remote to download from * @param filename where to store the temproray filename @@ -129,6 +125,26 @@ GIT_EXTERN(int) git_remote_negotiate(git_remote *remote); GIT_EXTERN(int) git_remote_download(char **filename, git_remote *remote); /** + * Check whether the remote is connected + * + * Check whether the remote's underlying transport is connected to the + * remote host. + * + * @return 1 if it's connected, 0 otherwise. + */ +GIT_EXTERN(int) git_remote_connected(git_remote *remote); + +/** + * Disconnect from the remote + * + * Close the connection to the remote and free the underlying + * transport. + * + * @param remote the remote to disconnect from + */ +GIT_EXTERN(void) git_remote_disconnect(git_remote *remote); + +/** * Free the memory associated with a remote * * @param remote the remote to free diff --git a/include/git2/repository.h b/include/git2/repository.h index 161826b26..2e9baf6c0 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -277,7 +277,7 @@ GIT_EXTERN(const char *) git_repository_path(git_repository *repo, git_repositor * Check if a repository is bare * * @param repo Repo to test - * @return 1 if the repository is empty, 0 otherwise. + * @return 1 if the repository is bare, 0 otherwise. */ GIT_EXTERN(int) git_repository_is_bare(git_repository *repo); diff --git a/include/git2/transport.h b/include/git2/transport.h index ddae32d40..f56a2f40a 100644 --- a/include/git2/transport.h +++ b/include/git2/transport.h @@ -27,6 +27,14 @@ GIT_BEGIN_DECL */ GIT_EXTERN(int) git_transport_new(git_transport **transport, const char *url); +/** + * Return whether a string is a valid transport URL + * + * @param tranport the url to check + * @param 1 if the url is valid, 0 otherwise + */ +GIT_EXTERN(int) git_transport_valid_url(const char *url); + /** @} */ GIT_END_DECL #endif diff --git a/include/git2/tree.h b/include/git2/tree.h index bd89de34f..8ac8b1682 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -308,9 +308,10 @@ enum git_treewalk_mode { * @param tree The tree to walk * @param callback Function to call on each tree entry * @param mode Traversal mode (pre or post-order) + * @param payload Opaque pointer to be passed on each callback * @return GIT_SUCCESS or an error code */ -GIT_EXTERN(int) git_tree_walk(git_tree *walk, git_treewalk_cb callback, int mode, void *payload); +GIT_EXTERN(int) git_tree_walk(git_tree *tree, git_treewalk_cb callback, int mode, void *payload); /** @} */ GIT_END_DECL |
