summaryrefslogtreecommitdiff
path: root/include/git2/remote.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-06-23 03:04:23 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-06-27 02:12:40 +0200
commit9ba49bb5c861651c5136ad6678fc1570801ddec1 (patch)
treefbe1d71384587a1be506cca4219a1bff129f3ff8 /include/git2/remote.h
parentc7c787ce0cd944c0e904d47c5ef1088de2fcf85a (diff)
downloadlibgit2-9ba49bb5c861651c5136ad6678fc1570801ddec1.tar.gz
Add git_remote_connect and git_remote_ls
These allow you to implement git-ls-remote when given a reference name and a repository. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'include/git2/remote.h')
-rw-r--r--include/git2/remote.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index ccc130578..9a988f36c 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -57,6 +57,27 @@ GIT_EXTERN(const git_refspec *) git_remote_fetchspec(struct git_remote *remote);
GIT_EXTERN(const git_refspec *) git_remote_fetchspec(struct git_remote *remote);
/**
+ * Open a connection to a remote
+ *
+ * The transport is selected based on the URL
+ *
+ * @param remote the remote to connect to
+ * @return GIT_SUCCESS or an error code
+ */
+GIT_EXTERN(int) git_remote_connect(struct git_remote *remote, git_net_direction dir);
+
+/**
+ * Get a list of refs at the remote
+ *
+ * The remote (or more exactly its transport) must be connected.
+ *
+ * @param refs where to store the refs
+ * @param remote the remote
+ * @return GIT_SUCCESS or an error code
+ */
+GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headarray *refs);
+
+/**
* Free the memory associated with a remote
*
* @param remote the remote to free