diff options
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/net.h | 8 | ||||
-rw-r--r-- | include/git2/remote.h | 12 | ||||
-rw-r--r-- | include/git2/transport.h | 40 | ||||
-rw-r--r-- | include/git2/types.h | 6 |
4 files changed, 14 insertions, 52 deletions
diff --git a/include/git2/net.h b/include/git2/net.h index 5fb918599..08bc81f16 100644 --- a/include/git2/net.h +++ b/include/git2/net.h @@ -30,6 +30,7 @@ GIT_BEGIN_DECL #define GIT_DIR_FETCH 0 #define GIT_DIR_PUSH 1 + /** * Remote head description, given out on `ls` calls. */ @@ -41,12 +42,9 @@ struct git_remote_head { }; /** - * Array of remote heads + * Callback for listing the remote heads */ -struct git_headarray { - unsigned int len; - struct git_remote_head **heads; -}; +typedef int (*git_headlist_cb)(git_remote_head *, void *); /** @} */ GIT_END_DECL diff --git a/include/git2/remote.h b/include/git2/remote.h index 2bc2d16ec..0ae38165c 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -10,6 +10,8 @@ #include "common.h" #include "repository.h" #include "refspec.h" +#include "net.h" + /** * @file git2/remote.h * @brief Git remote management functions @@ -107,7 +109,7 @@ GIT_EXTERN(int) git_remote_connect(git_remote *remote, int direction); * @param remote the remote * @return GIT_SUCCESS or an error code */ -GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headarray *refs); +GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void *payload); /** * Download the packfile @@ -161,6 +163,14 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote); */ GIT_EXTERN(int) git_remote_update_tips(git_remote *remote); +/** + * Return whether a string is a valid remote URL + * + * @param tranport the url to check + * @param 1 if the url is valid, 0 otherwise + */ +GIT_EXTERN(int) git_remote_valid_url(const char *url); + /** @} */ GIT_END_DECL #endif diff --git a/include/git2/transport.h b/include/git2/transport.h deleted file mode 100644 index f56a2f40a..000000000 --- a/include/git2/transport.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2009-2011 the libgit2 contributors - * - * This file is part of libgit2, distributed under the GNU GPL v2 with - * a Linking Exception. For full terms see the included COPYING file. - */ -#ifndef INCLUDE_git_transport_h__ -#define INCLUDE_git_transport_h__ - -#include "common.h" -#include "types.h" -#include "net.h" - -/** - * @file git2/transport.h - * @brief Git protocol transport abstraction - * @defgroup git_transport Git protocol transport abstraction - * @ingroup Git - * @{ - */ -GIT_BEGIN_DECL - -/** - * Get the appropriate transport for an URL. - * @param tranport the transport for the url - * @param url the url of the repo - */ -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/types.h b/include/git2/types.h index 1df18974a..ea97ee915 100644 --- a/include/git2/types.h +++ b/include/git2/types.h @@ -161,13 +161,7 @@ typedef enum { typedef struct git_refspec git_refspec; typedef struct git_remote git_remote; -/** A transport to use */ -typedef struct git_transport git_transport; - -typedef int (*git_transport_cb)(git_transport **transport); - typedef struct git_remote_head git_remote_head; -typedef struct git_headarray git_headarray; /** @} */ GIT_END_DECL |